A library that implements serialization of simple data objects as JSON data.
Project description
anyjsonthing
🧐 About
This repository contains the code of anyjsonthing
, a Python library that implements serialization of simple data
objects as JSON data.
For additional details on how to use the library, please have a look at the enclosed documentation.
(Notice that you currently have to build the documentation by yourself, as described below.)
NOTICE: All tickets related to this project are available on JIRA.
🏁 Getting Started
The repository uses just
(a build tool like Makefile
) to automate common tasks such
as testing, building, etc.
To list all available recipes, run the following command in the project directory:
$ just -l
Available recipes:
build-docs # Builds the documentation.
build-library # Builds the anyjsonthing library.
clean # Cleans up all generated files.
dev-env # Creates a Conda environment (called "anyjsonthing") for local development/testing.
print-version # Prints the currently specified version of the library.
publish-library # Publishes the library in the PyPI.
test # Runs all unit tests in the test directory.
test-publish-library # Publishes the library in the TestPyPI.
Notice the recipe dev-env
(which can be executed by running just dev-env
), which creates a
Conda environment (called anyjsonthing
) that contains all dependencies required
for local development and testing.
🚀 Building & Publishing
There are ready-made just
recipes for all build tasks:
just build-library
– Builds the library using Python's standardbuild
module. The resulting files are placed in thedist
folder, which is created in the project root.just publish-library
– Publishes the built library in the PyPI. Notice that this recipe automatically runs thebuild-library
recipe first. Furthermore, please notice the required configuration, as described below.just test-publish-library
– This recipe exist for testing purposes and is identical to thepublish-library
recipe except that it publishes the library in the TestPyPI. Again, please consider the required configuration.just build-docs
– Builds the documentation of the library, which is placed indocs/build
.
In this repository, we follow the convention that the version of the library (as published in the PyPI) is specified in
the Python module version.py
located in the project root.
Hence, you should never have any need to directly adjust the setup.cfg
, which configures the details of the build
process used to assemble the created Python package.
🏗 CI/CD
This project makes use of a simple CI/CD pipeline that consists of the following steps:
- On every push, all unit tests in the test directory (
src/test
) are executed usingjust test
. - If a push occurred on the
main
branch and the tests finished successfully, then the library is automatically built and published in the PyPI. Furthermore, the respective commit is tagged with the published version of the library (i.e.,vX.Y.Z
).
⚙️ Configuration
The CI/CD pipeline of this project requires the following secrets (for GitHub actions) to be in place:
Secret | Description |
---|---|
PYPI_TOKEN |
The access token of the PyPI account that is used for publishing the library. |
For local building and publishing, you further need to specify the following configuration values in an env file called
.env
(without any name before the dot!), which has to be located in the project root:
Env Variable | Description |
---|---|
PYPI_TOKEN |
The access token of the PyPI account that is used for publishing the library. |
PYPI_TEST_TOKEN |
The access token of the TestPyPI account that is used for testing publishing of the library. |
✍️ Authors
- Patrick Hohenecker (patrick.hohenecker@gmx.at)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file anyjsonthing-0.4.0.tar.gz
.
File metadata
- Download URL: anyjsonthing-0.4.0.tar.gz
- Upload date:
- Size: 14.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c52c185199e9e5013affecfcf39815a4412026455b035601467a142909eb117a |
|
MD5 | a04cac585650a22ca9ae6da783cc37a0 |
|
BLAKE2b-256 | 8a1e26754cd66b38a046a9f9970138c30424d26f91cdaa4ef95316f5a2590e88 |
File details
Details for the file anyjsonthing-0.4.0-py3-none-any.whl
.
File metadata
- Download URL: anyjsonthing-0.4.0-py3-none-any.whl
- Upload date:
- Size: 17.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ec0d12ab8fb484beb3dc36006424c606777625ae9253fecc166874f951ce419f |
|
MD5 | 45f57166aa5a8f1ba12360e8ebe566ea |
|
BLAKE2b-256 | 7e633b6ab912c2b5b0ea008eb36653ba0867dac28a4293978104f049b5378a20 |