Skip to main content

Real brasileiro

Status do projeto: Em desenvolvimento

este projeto tem como objetivo me ajudar na formatação, sanitização e apresentação dos valores com os quais eu diariamente trabalho.

Download

$pip install real-brasileiro

Entradas

from real_br import Real

print(Real(10.10),
    Real(10),
    Real('R$ 100,55'))

Nos testes você consegue conferir melhor em quais formatos a classe aceita os valores.

Criando objeto

from real_br import Real

valor = 10
real = Real(valor)
print(real)

você também pode obter o equivalente em centavos usando

from real_br import Real

valor = 10
real = Real(valor)
print(real.centavos)

A classe retorna float, str e int (int é retornado em centavos)

from real_br import Real

valor = 10
real = Real(valor)
print(float(real),  int(real), str(real))

A classe possui 100% de cobertura de testes

pytest -cov

Metadata

Release files for real-brasileiro 0.2.7

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

Source distribution (sdist)

Source distribution for real-brasileiro 0.2.7
File Size Uploaded Provenance Actions
real-brasileiro-0.2.7.tar.gz 3.4 kB Without provenance Details for real-brasileiro-0.2.7.tar.gz

Release files / real-brasileiro-0.2.7.tar.gz

Download URL real-brasileiro-0.2.7.tar.gz
Size 3.4 kB
Tags Source
SHA-256 checksum
How to use checksums
b2d9d9051d1b94ee6abf81417a5fc44b067cf3ce6726771b24d145f9acf1b4a2
BLAKE2b-256 checksum
How to use checksums
aa97a73f2ffd1b791d0f4ecd0c87a938565fa0f79b99bc006f814b7b94e9b3c8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.6

Security for real-brasileiro 0.2.7

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.

Release history Release notifications | RSS feed

This release

0.2.7 This release

1 release file No provenance

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