Skip to main content

Multi-purposes conversors for Python

GitHub license pypi version

Installation

Use the package manager pip to install general-conversors.

pip3 install general-conversors

Usage

To 1-Level dictionary

from conversor.dict import ToOneLevel

source = {
  'error': False,
  'result': {
    'executed': True,
    'payload': 'Hello world',
    'code': 200,
    'source_code_url': 'http://google.com'
  }
}

## replace_underscore as True
conversor = ToOneLevel(source=source, replace_underscore=True)
result = conversor.convert()
print('Result replacing underscore:', result)
# Result replacing underscore: {'error': False, 'result.executed': True, 'result.payload': 'Hello world', 'result.code': 200, 'result.source.code.url': 'http://google.com'}

## replace_underscore as False (Default)
conversor = ToOneLevel(source=source)
result = conversor.convert()
print('Result:', result)
# Result: {'error': False, 'result.executed': True, 'result.payload': 'Hello world', 'result.code': 200, 'result.source_code_url': 'http://google.com'}

To N-level level dictionary

from conversor.dict import ToMultiLevel

source = {
  'error': False,
  'result.executed': True,
  'result.payload': 'Hello world',
  'result.code': 200
}

conversor = ToMultiLevel(source=source)
result = conversor.convert()
print('Result:', result)
# Result: {'error': False, 'result': {'executed': True, 'payload': 'Hello world', 'code': 200}}

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT

Metadata

Release files for general-conversors 1.0.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for general-conversors 1.0.8
File Size Uploaded Provenance Actions
general-conversors-1.0.8.tar.gz 6.3 kB Without provenance Details for general-conversors-1.0.8.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for general-conversors 1.0.8
File Interpreter ABI Platform Actions
general_conversors-1.0.8-py3-none-any.whl Python 3 none any Details for general_conversors-1.0.8-py3-none-any.whl

Total release size: 10.7 kB

Release files / general-conversors-1.0.8.tar.gz

Download URL general-conversors-1.0.8.tar.gz
Size 6.3 kB
Tags Source
SHA-256 checksum
How to use checksums
95139f9379b64d0c3bfe3deea26192f311ba6e9aaa24a667789076c00d3ab945
BLAKE2b-256 checksum
How to use checksums
503058e799a5f4e64714765425d162d43be1776526de29f08071406b4e8ed49d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.8

Release files / general_conversors-1.0.8-py3-none-any.whl

Download URL general_conversors-1.0.8-py3-none-any.whl
Size 4.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9f30a7a9a3165d33efe07e8a8a7568509ada578299da6e057d10c25c932bb051
BLAKE2b-256 checksum
How to use checksums
0cce22b5e9802761861b2cf7614327014e27c385233025e672d11548c05b39f8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.8

Security for general-conversors 1.0.8

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page