Near the end of December 2022, I found myself needing to generate lots of .8xl files. The go-to tool for this is tivars_lib_cpp, a C++ library written by Adriweb that can interface with most var types found on the 82/83/84 series. I've used it plenty before, and it is a demonstrably robust library, but C++ itself can be a bit... obtuse, especially for the uninitiated user.

Thus, I created tivars_lib_py, a sister library designed with the Pythonista in mind. The library thus far best aids scripting and quick creation or viewing of var files; tivars_lib_cpp remains the far superior choice for large backends like CEmu.

The project has been in steady development since January, and can currently support real/complex numbers, lists, matrices, programs/equations/strings, and window settings. GDBs are also nearing full support, with myself, Adriweb, and LogicalJoe collaborating on a common JSON format to more easily edit GDBs and share them between the two libraries. Indeed, we are working to keep the libraries as interoperable as possible, so that any decision to use one or the other comes down to preference and use case rather than a lack of functionality.

Of course, there's still some work to be done. A partial release will be pushed once GDBs are all done and dusted, followed by other small releases for pictures, images, exact types, and appvars. The first full release will have tivars_lib_py be in equal capability with its C++ sister. All of these releases will be pushed to GitHub, linked above. Progress on individual type implementations can be found here. It is worth noting, though, that any var file can be read and poked at just fine; you just might be missing type-specific helper methods and documentation until that type is marked as complete.

If you're interested in "live" discussion of this project and similar endeavors, you can join the TI-Toolkit Discord server. TI-Toolkit is a newly-formed organization of developers striving to make tools and documentation for TI calculators more accessible to the aspiring enthusiast. You can find our repositories on GitHub, tivars_lib_py among them; contributions are greatly encouraged!

Otherwise, you can check this thread for larger updates, including all major and minor releases. Suggestions for improving the library's functionality, usability, or really anything else are welcome here, on Discord, or in GitHub issues.
Nice work so far! It looks like you've been working hard on this. Question: why re-implement in Python rather than writing some Boost::Python wrappers for tivars_lib_cpp?
KermMartian wrote:
Nice work so far! It looks like you've been working hard on this. Question: why re-implement in Python rather than writing some Boost::Python wrappers for tivars_lib_cpp?

I guess that has two answers. One, I don't know Boost and only barely know C++ (thanks higher education). Two, I wanted to write my own interface from the ground up, as I think Python has some fundamental differences from C++ when it comes to use cases that warrant a different approach to things. Plus it was super satisfying to get the basic file reading working.

(Also, note to self, the mono tag exists.)
Also, as usual, such healthy competition made me work on improvements on tivars_lib_cpp (and the aforementioned GDB handling), so, everybody wins I guess Smile

Anyway, great job!
Though I had intended to drop a release once GDBs were done and dusted, I had an itch to get pictures and images working, so you can find initial support for .8xi, .8ci, and .8ca types on GitHub. GDBs need some more vetting (particularly with the JSON format and monochrome <-> color conversion), but once that's completed I'll probably bump the first pre-release to include pictures and images.

I've also started an examples section on the repo, which will receive incremental attention as more use cases come up. It currently contains details on loading lists and matrices into NumPy and viewing images with Pillow/PIL. As always, PRs are welcome!
I'm happy to report that I was able to update and fix various things on tivars_lib_cpp (which incidentally made LogicalJoe and kg583 update and fix similar issues on their code too), and it looks like both tivars_lib_cpp and tivars_lib_py load and output compatible JSON files for GDB vartypes Smile

The JSON schema is available here: https://github.com/TI-Toolkit/tivars_lib_py/blob/main/tivars/types/gdb.schema.json
The first pre-release of tivars_lib_py is now out on GitHub. You can check it out here or just wait for v1.0 to drop (eventually). Everything up to GDBs and pictures has been implemented, with the 83PCE exact types next on the docket for v0.7.
Newest pre-release (v0.7.3) is out on GitHub and on PyPi. All the exact types have been implemented, along with appvars. Lots of metadata sections have been updated to be more accurate and automatically set on export. The lib also now uses TI Toolkit's token sheets, which contain detailed versioning and tokenization information for each and every token for the 73 and 8X series.

There are also two new documentation sources:
    The official docs detail all API information, automatically generated from the lib's docstrings. Currently, all the entry types are lopped into one page due to pdoc's unconfigurable behavior, so I'm looking to switch to Sphinx soon.

    The wiki is an approximate clone of the 83+ Link Guide, updated for ez80 models. The current pages are mostly generated from the lib's docs and are still WIP. Pages for the exact types are also not yet available since the generator script I was using doesn't yet handle them (and I'm switching to writing them manually anyway).
Brand new, beautiful API docs are now live thanks not to Sphinx, but pydoctor. Each module and class now has its own dedicated page, along with a global class hierarchy and alphabetical index. Contributions are always welcome for missing docstrings and formatting improvements.
Newest pre-release (v0.8.0) is out on GitHub and on PyPI. There are two big additions this release:

    - Support for (un)grouping group objects into/from their component entries

    - Plugins for the Python Imaging Library to interface with TI's image types

As always, bug reports and contributions are welcome. I'd particularly appreciate any additional lib examples to add to the repo; a handful of common operations have been catalogued in examples/misc.py.

The home stretch is in sight, with flash files being the last major hurdle before v1.0.0.
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement