A previous release had provenance metadata, but this release does not. View details.
pycodify
Python source code as a serialization format with automatic import resolution.
Quick Start
from pycodify import Assignment, generate_python_source
from dataclasses import dataclass
@dataclass
class Config:
name: str = "default"
value: int = 42
config = Config(name="production", value=100)
code = generate_python_source(Assignment("config", config))
print(code)
# Output:
# from __main__ import Config
# config = Config(name='production', value=100)
Why Python Source?
| Format | Diffable | Inspectable | Editable | Type-preserving | Cross-version |
|---|---|---|---|---|---|
| pickle | ✗ | ✗ | ✗ | ✓ | ✗ |
| JSON/YAML | ✓ | ✓ | ✓ | ✗ | ✓ |
| Python source | ✓ | ✓ | ✓ | ✓ | Depends on imported APIs |
Binary formats like pickle cannot be diffed, inspected, or edited. Text
formats like JSON lose type information. Python source is diffable, inspectable,
editable, and type-preserving, but replay still depends on the imported APIs and
constructor signatures remaining compatible.
Features
- Complete Executable Source: Generates imports + code, not just expressions
- Type-Preserving: Enums, Paths, callables serialize as themselves
- Collision Handling: Automatic aliasing for name collisions across modules
- Clean Mode: Omit fields matching defaults for concise output
- Extensible: Register custom formatters for domain-specific types
Documentation
Explicit mode is the default (clean_mode=False), preserving every field for
reproducibility. Pass clean_mode=True only when concise, default-eliding
source is desired.
Generated output is executable Python, not a sandboxed data format. Review it
before execution and never call exec on source generated from untrusted
objects, custom formatters, headers, or edited files.
Full documentation available at pycodify.readthedocs.io
Installation
pip install pycodify
License
MIT
Metadata
Release files for pycodify 0.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Loss of provenance
These files do not have provenance metadata, despite files in a prior release including this data.
We recommend further investigation before installing these files. View details.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pycodify-0.2.1.tar.gz | 29.2 kB | Without provenance | Details for pycodify-0.2.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pycodify-0.2.1-py3-none-any.whl | Python 3 | none | any | Details for pycodify-0.2.1-py3-none-any.whl |
Total release size: 41.6 kB
Release files / pycodify-0.2.1.tar.gz
Loss of provenance
This file belongs to a release without provenance metadata, despite a prior release including this data.
We recommend further investigation before installing this file. View details.
| Download URL | pycodify-0.2.1.tar.gz |
|---|---|
| Size | 29.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
872539cd676038525ee70b74ac6dfddfe1a310c8f756f444a32c05676c23f798
|
|
BLAKE2b-256 checksum How to use checksums |
21e5a6d7f8d724b41c1385941d72011a4c9e3a989b3f80e24a8a052b95956b1d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.14
|
Release files / pycodify-0.2.1-py3-none-any.whl
Loss of provenance
This file belongs to a release without provenance metadata, despite a prior release including this data.
We recommend further investigation before installing this file. View details.
| Download URL | pycodify-0.2.1-py3-none-any.whl |
|---|---|
| Size | 12.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b3286d925fed2ef4dc5e65cebdb7a2939e3a38a7ce07b4e705bdaa6fd47928bf
|
|
BLAKE2b-256 checksum How to use checksums |
e014bba29c6e8766fa1b6ba90e0ae83d58e78b073f1fbd04e20383823d933e9c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.14
|
Security for pycodify 0.2.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.
Loss of provenance
A previous release of these files had provenance metadata, but this release does not.
While this could reflect a routine change by the project maintainers, it may also indicate that the release files have been compromised.
Release comparison
- Removed 0.2.0 2 files With provenance
- Added 0.2.1 2 files Without provenance
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.