Skip to content

Commit

Permalink
improve CLI and switch to Poetry
Browse files Browse the repository at this point in the history
  • Loading branch information
neysofu committed Sep 28, 2022
1 parent 0d19a62 commit 5706c3a
Show file tree
Hide file tree
Showing 84 changed files with 1,500 additions and 780 deletions.
40 changes: 27 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# FIX2dict
# FIX2json

![PyPI - Version](https://img.shields.io/pypi/v/fix2dict)
![PyPI - License](https://img.shields.io/pypi/l/fix2dict)
![PyPI - Version](https://img.shields.io/pypi/v/fix2json)
![PyPI - License](https://img.shields.io/pypi/l/fix2json)

FIX2dict is a FIX Dictionary generator tool.
FIX2json is a FIX Dictionary generator tool.

The program performs data enhancing and data sanitazion on raw FIX Repository files. It allows you to The resulting data will feature:

Expand All @@ -22,17 +22,17 @@ The program performs data enhancing and data sanitazion on raw FIX Repository fi

Developers working with the FIX Protocol can really benefit from higher-quality JSON (rather than clunky XML) sources to use for code generation, data explorations, and so on.

In short, FIX2dict makes it much easier to work with the FIX protocol.
In short, FIX2json makes it much easier to work with the FIX protocol.

## How to use

First, you must install FIX2dict:
First, you must install FIX2json:

$ pip3 install fix2dict
$ pip3 install fix2json

You can now type `fix2dict --help` for thorough usage information. Here's an example:
You can now type `fix2json --help` for thorough usage information. Here's an example:

$ fix2dict --improve-docs=1 fix_repository/Unified/ empty/
$ fix2json --improve-docs=1 fix_repository/Unified/ empty/
Written to 'empty/fix-4-0.json'.
Written to 'empty/fix-4-1.json'.
Written to 'empty/fix-4-2.json'.
Expand All @@ -45,16 +45,30 @@ You can now type `fix2dict --help` for thorough usage information. Here's an exa

You can also install from source:

$ git clone [email protected]:fixipe/fix2dict.git
$ pip3 install -e fix2dict
$ git clone [email protected]:fixipe/fix2json.git
$ pip3 install -e fix2json

## Codebase tour

Main application code is inside `fix2dict/`. `empty/` was introduced as a handy, catch-all target directory for test runs.
Main application code is inside `fix2json/`. `empty/` was introduced as a handy, catch-all target directory for test runs.

`resources/errata` contains random Fix Repository errata in JSON format. It is *not* complete. You should always prefer updating this repository rather than making manual fixes to output files.
`tools/` contains web crawlers for [FixTrading.org](https://fixtrading.org). This allows for automatical download of EP definition files and other useful resources.

## Contributing

```
# Setup poetry
$ pip install poetry
$ poetry install
# Test your changes
$ poetry run fix2json --help
# Useful scripts for local development
$ poetry run python scripts/ep_page_to_links.py ...
```

## License

Copyright (c) 2020, Filippo Costa. This software is released under the terms of [Apache License 2](https://www.apache.org/licenses/LICENSE-2.0.txt).
Copyright (c) 2020, Filippo Costa. This software is released under the terms of [Apache License 2](https://www.apache.org/licenses/LICENSE-2.0.txt).
16 changes: 8 additions & 8 deletions docs/unveiling-fixtodict.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Hello!
I would like to unveil a project I've been working on for the last couple of weeks. It's fully open source and you can check it out [here](https://github.com/fixipe/fix2dict/).
I would like to unveil a project I've been working on for the last couple of weeks. It's fully open source and you can check it out [here](https://github.com/fixipe/fix2json/).

When I started working on FIX2dict, I set out to dramatically improve the state of the art for programmatic access to FIX Repository data. This is made possible by adopting the widespread JSON data format, as well as two other popular web standards:
When I started working on FIX2json, I set out to dramatically improve the state of the art for programmatic access to FIX Repository data. This is made possible by adopting the widespread JSON data format, as well as two other popular web standards:

1. JSON Schema.
2. JSON Patch.
Expand All @@ -11,21 +11,21 @@ FIX Repository has traditionally been released as XML files, but XML itself is m
* You often need third-party, poorly-supported libraries to work with XML. In recent years (decades, actually), most APIs and tools have switched to less verbose and more ubiquitous data formats.
* JSON is extremely popular and benefits from a huge range of existing tooling.

Hopefully, I have made my case clear for considering the JSON ecosystem over XML for FIX Repository. As a proof of concept, I am releasing FIX2dict.
Hopefully, I have made my case clear for considering the JSON ecosystem over XML for FIX Repository. As a proof of concept, I am releasing FIX2json.

# Introduction to FIX2dict
# Introduction to FIX2json

FIX2dict is a collection of related tools to read, update, modify FIX Repository data. First and foremost, it allows you to transform original FIX Repository data (i.e. `.xml`) into JSON. A standard-compliant [JSON Schema](https://json-schema.org/) description describes the format of produced data. This way, a lot of jobs can become much easier:
FIX2json is a collection of related tools to read, update, modify FIX Repository data. First and foremost, it allows you to transform original FIX Repository data (i.e. `.xml`) into JSON. A standard-compliant [JSON Schema](https://json-schema.org/) description describes the format of produced data. This way, a lot of jobs can become much easier:

- Code generation. FIX2dict supersedes software like [`fix-repository-to-quickfix-xml`](https://code.google.com/archive/p/fix-repository-to-quickfix-xml/).
- Code generation. FIX2json supersedes software like [`fix-repository-to-quickfix-xml`](https://code.google.com/archive/p/fix-repository-to-quickfix-xml/).
- Documentation generation. Programmatic generation of both high-quality documentation files (in formats like `.pdf`, `.doc`) and browser-oriented tools becomes much easier. A proof of concept is currently in the works.

# About Extension Packs

FIX2dict can also transform EP files (`.xml`) into a [JSON Patch](https://tools.ietf.org/html/rfc6902) file. We can leverage JSON Patch -already standardized by W3C- to completely remove the need for XSLT scripts and DDT
FIX2json can also transform EP files (`.xml`) into a [JSON Patch](https://tools.ietf.org/html/rfc6902) file. We can leverage JSON Patch -already standardized by W3C- to completely remove the need for XSLT scripts and DDT

# Conclusions

I welcome feedback and I remain available for further clarifications. You can contact me at my personal email address [`[email protected]`](mailto:[email protected]). Hopefully members of the FIX Trading Community will see this as a great opportunity for lowering the barrier of access to the FIX Repository, which is at the heart of any serious tool for FIX.

Finally, just as a powerful example of what can be readily achieved with high-quality FIX Repository data, you can have a look at [fixipe.com](https://fixipe.com). It was built leveraging FIX2dict's features and, with some more work, it could work great not only as online FIX Dictionary but also as editor, allowing people to create custom EPs and then export them in multiple formats.
Finally, just as a powerful example of what can be readily achieved with high-quality FIX Repository data, you can have a look at [fixipe.com](https://fixipe.com). It was built leveraging FIX2json's features and, with some more work, it could work great not only as online FIX Dictionary but also as editor, allowing people to create custom EPs and then export them in multiple formats.
6 changes: 0 additions & 6 deletions fix2dict/__init__.py

This file was deleted.

6 changes: 0 additions & 6 deletions fix2dict/__version__.py

This file was deleted.

9 changes: 0 additions & 9 deletions fix2dict/cli/__init__.py

This file was deleted.

20 changes: 0 additions & 20 deletions fix2dict/cli/convert_ep.py

This file was deleted.

68 changes: 0 additions & 68 deletions fix2dict/cli/convert_repo.py

This file was deleted.

18 changes: 0 additions & 18 deletions fix2dict/cli/filter_patch.py

This file was deleted.

19 changes: 0 additions & 19 deletions fix2dict/cli/jsonpatch.py

This file was deleted.

35 changes: 0 additions & 35 deletions fix2dict/cli/main.py

This file was deleted.

15 changes: 0 additions & 15 deletions fix2dict/cli/review.py

This file was deleted.

10 changes: 0 additions & 10 deletions fix2dict/cli/schema.py

This file was deleted.

17 changes: 0 additions & 17 deletions fix2dict/cli/utils/json.py

This file was deleted.

46 changes: 0 additions & 46 deletions fix2dict/cli/xref.py

This file was deleted.

Empty file removed fix2dict/formats/__init__.py
Empty file.
Loading

0 comments on commit 5706c3a

Please sign in to comment.