Uma biblioteca de exemplo com operações matemáticas.
Project description
Sample Math Lib
Esta é uma biblioteca Python simples de exemplo que fornece funções matemáticas básicas. O objetivo deste projeto é demonstrar o passo a passo da criação de uma biblioteca Python, desde a estrutura do projeto até a publicação no GitHub.
Instalação
Você pode instalar a biblioteca diretamente do GitHub usando pip:
pip install git+https://github.com/adonitech-solutions/sample-python-lib.git
Alternativamente, você pode baixar os arquivos .whl ou .tar.gz da seção de Releases e instalar localmente com pip:
# Exemplo para o arquivo .whl
pip install /caminho/para/o/arquivo/sample_math_lib-0.0.1-py3-none-any.whl
Como Usar
Aqui estão alguns exemplos de como usar as funções da biblioteca:
from adonitech.sample_math_lib.operations import add, subtract, multiply, divide
# Operações básicas
soma = add(10, 5)
subtracao = subtract(10, 5)
multiplicacao = multiply(10, 5)
divisao = divide(10, 5)
print(f"Soma: {soma}")
print(f"Subtração: {subtracao}")
print(f"Multiplicação: {multiplicacao}")
print(f"Divisão: {divisao}")
# Exemplo de tratamento de erro para divisão por zero
try:
divide(10, 0)
except ValueError as e:
print(f"Erro: {e}")
Executando os Testes
Para contribuir com o desenvolvimento ou validar a integridade do código, você pode executar os testes. O projeto utiliza pytest e gerencia as dependências de desenvolvimento através do pyproject.toml.
Primeiro, clone o repositório:
git clone https://github.com/adonitech-solutions/sample-python-lib.git
cd sample-python-lib
Em seguida, instale a biblioteca em modo de desenvolvimento:
pip install -e ".[test]"
Agora você pode executar os testes a partir do diretório raiz do projeto:
pytest
Licença
Este projeto está licenciado sob a Licença MIT. Veja o arquivo LICENSE para mais detalhes.
Project details
Release history Release notifications | RSS feed
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sample_math_lib-0.1.0.tar.gz.
File metadata
- Download URL: sample_math_lib-0.1.0.tar.gz
- Upload date:
- Size: 3.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9c8f4f73678cd848c6e647fa6771dc8e6f6909bfe52697806abd3890bdb4dcf9
|
|
| MD5 |
78cc30a02650481a564672b7a3437f92
|
|
| BLAKE2b-256 |
427963bf230782ed6bf9b3c18524b9d716f1bf6755db7e23e4ea89fbd0dc767c
|
Provenance
The following attestation bundles were made for sample_math_lib-0.1.0.tar.gz:
Publisher:
publish.yml on adonitech-solutions/sample-math-lib
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sample_math_lib-0.1.0.tar.gz -
Subject digest:
9c8f4f73678cd848c6e647fa6771dc8e6f6909bfe52697806abd3890bdb4dcf9 - Sigstore transparency entry: 273017139
- Sigstore integration time:
-
Permalink:
adonitech-solutions/sample-math-lib@90ead2e896aa05dde4e6a9bf8a79557894a698a4 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/adonitech-solutions
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@90ead2e896aa05dde4e6a9bf8a79557894a698a4 -
Trigger Event:
release
-
Statement type:
File details
Details for the file sample_math_lib-0.1.0-py3-none-any.whl.
File metadata
- Download URL: sample_math_lib-0.1.0-py3-none-any.whl
- Upload date:
- Size: 3.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c393b4e64f6def2dda3d7438606a92d4dd96bbf6e910cc9eb5dd0e7776ef31a6
|
|
| MD5 |
46d293448e16a8449c03ebcb8c323e41
|
|
| BLAKE2b-256 |
da6aa1e46485e5ca0b3bcc39b158a4b0000e5e97aed2ba5fa27831d14cedc867
|
Provenance
The following attestation bundles were made for sample_math_lib-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on adonitech-solutions/sample-math-lib
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sample_math_lib-0.1.0-py3-none-any.whl -
Subject digest:
c393b4e64f6def2dda3d7438606a92d4dd96bbf6e910cc9eb5dd0e7776ef31a6 - Sigstore transparency entry: 273017141
- Sigstore integration time:
-
Permalink:
adonitech-solutions/sample-math-lib@90ead2e896aa05dde4e6a9bf8a79557894a698a4 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/adonitech-solutions
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@90ead2e896aa05dde4e6a9bf8a79557894a698a4 -
Trigger Event:
release
-
Statement type: