beancount-hypothesis
A package which provides hypothesis strategies for generating beancount types.
Usage
Strategies are provided for all of the core types present in beancount. The
below example generates a random list of directives:
import beancount_hypothesis as h
from hypothesis import given, strategies as s
@given(
s.recursive(
h.balance()
| h.close()
| h.commodity()
| h.custom()
| h.document()
| h.event()
| h.note()
| h.open()
| h.query()
| h.pad()
| h.price()
| h.transaction(),
s.lists,
max_leaves=5,
)
)
Most of the types have restrictions placed on them with the following philosophy:
- The value shouldn't break the
beancountpackage - The value should be somewhat authentic (i.e. resemble user data)
Note that the input generated from the strategies is not intended to be passed to any beancount functions. In other words, passing the above example to the loader will result in undefined behavior as it doesn't follow any sensible rules.
Testing
tox
While testing a package meant for tests seems slightly redundant, there are
some custom compositions present that benefit from testing. In most cases the
tests just assert that generating data doesn't raise any exceptions (i.e. break
beancount in some way).
Contributing
Check out the issues for items needing attention or submit your own and then:
- Fork the repo
- Create your feature branch (git checkout -b feature/fooBar)
- Commit your changes (git commit -am 'Add some fooBar')
- Push to the branch (git push origin feature/fooBar)
- Create a new Pull Request
Metadata
Release files for beancount-hypothesis 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| beancount-hypothesis-0.1.1.tar.gz | 7.2 kB | Without provenance | Details for beancount-hypothesis-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| beancount_hypothesis-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for beancount_hypothesis-0.1.1-py3-none-any.whl |
Total release size: 15.4 kB
Release files / beancount-hypothesis-0.1.1.tar.gz
| Download URL | beancount-hypothesis-0.1.1.tar.gz |
|---|---|
| Size | 7.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
93b02db78cf3c7eb122554818aa87555b8d63161c2f6bdb287b8ed45e63446ac
|
|
BLAKE2b-256 checksum How to use checksums |
3b4e44b1603a3680308ead824ef11b5e72a8c3fe85d3c78119aae490682e0f43
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2
|
Release files / beancount_hypothesis-0.1.1-py3-none-any.whl
| Download URL | beancount_hypothesis-0.1.1-py3-none-any.whl |
|---|---|
| Size | 8.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
fc470b4257a02e34826171354cc5b822c7c438fad85ca27fe0f854d3fbc05ac3
|
|
BLAKE2b-256 checksum How to use checksums |
d8db9f2b82592425b28453e61a7b5645ae805172070fd145e445d7d1df77273b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2
|
Security for beancount-hypothesis 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.