Skip to main content

Encryptcode tool to encrypt python files

Project description

This respository is to build any python package and push it ot PyPI repository

Procedure (Detailed):

1. Project Structure

Organize your project like this:

your_project/
│
├── src/your_package/          # Your actual Python code
│   ├── __init__.py
│   ├── module1.py
│   └── module2.py
│
├── tests/                     # Optional tests
│   └── test_module1.py
│
├── pyproject.toml             # Modern way to declare build system
├── setup.cfg                  # Metadata & configs
├── README.md                  # Description (shown on PyPI)
├── LICENSE                    # License (MIT, Apache2, etc.)
└── MANIFEST.in                # (optional) include non-Python files

2. pyproject.toml

This tells pip how to build your package. Example:

[build-system]
requires = ["setuptools>=61.0"]
build-backend = "setuptools.build_meta"

[project]
name = "your-package-name"         # must be unique on PyPI
version = "0.1.0"
description = "A short description of your package"
readme = "README.md"
requires-python = ">=3.8"
license = {text = "MIT"}
authors = [
  {name = "Your Name", email = "you@example.com"}
]
dependencies = [
  "requests>=2.0",
]

[project.urls]
Homepage = "https://github.com/yourusername/your_project"

3. setup.cfg (optional, metadata in pyproject.toml is enough, but you can split)

[metadata]
name = your-package-name
version = 0.1.0
author = Your Name
author_email = you@example.com
description = A short description
long_description = file: README.md
long_description_content_type = text/markdown
url = https://github.com/yourusername/your_project
license = MIT

[options]
package_dir =
    = src
packages = find:
python_requires = >=3.8

[options.packages.find]
where = src

4. Build the Package

First install the tools:

pip install build twine

Then build your distribution:

python -m build

This creates:

dist/
  your_package_name-0.1.0.tar.gz
  your_package_name-0.1.0-py3-none-any.whl

5. Install Locally (test before uploading)

pip install dist/your_package_name-0.1.0-py3-none-any.whl

or for development mode:

pip install -e .

6. Upload to PyPI

Create a PyPI account: https://pypi.org/account/register/

Upload with Twine:

python -m twine upload dist/*

If you want to test before real PyPI, use TestPyPI:

python -m twine upload --repository testpypi dist/*

✅ Now your module is pip install your-package-name ready!

Procedure (Simplified):

🔹 1. Install Required Tools

Make sure you have the build & upload tools installed:

pip install build twine

🔹 2. Build Your Package

From your project root (where pyproject.toml / setup.cfg lives):

python -m build


This creates a dist/ folder with files like:

dist/
  your_package-0.1.0-py3-none-any.whl
  your_package-0.1.0.tar.gz

🔹 3. Upload With Twine

Upload to PyPI (public)

twine upload dist/*

Upload to TestPyPI (sandbox)

twine upload --repository testpypi dist/*

🔹 4. Authentication

The first time, Twine will ask for your PyPI username and password. Best practice now is to use API tokens instead of your account password.

Go to your PyPI account → Account settings → API tokens.

Create a token with scope “Entire account” (or project-specific).

Copy the token (looks like pypi-AgENdGVzdC5weXBpLm9yZw...).

Then use it when prompted:

username = __token__

password = <your-api-token>

🔹 5. Store Credentials Securely (Optional)

Instead of typing credentials every time, you can set them up in ~/.pypirc:

[pypi]
  username = __token__
  password = pypi-AgENdGVzd...

[testpypi]
  repository = https://test.pypi.org/legacy/
  username = __token__
  password = pypi-AgENdGVzd...

Now you can upload with:

twine upload -r pypi dist/*

or

twine upload -r testpypi dist/*

🔹 6. Verify Upload

After a successful upload:

PyPI: https://pypi.org/project/your-package-name/
TestPyPI: https://test.pypi.org/project/your-package-name/

Users can then install:

pip install your-package-name

or from TestPyPI:

pip install --index-url https://test.pypi.org/simple/ your-package-name

✅ That’s the complete flow: build → upload with twine → authenticate → verify.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

encryptcode-0.1.1.tar.gz (5.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

encryptcode-0.1.1-py3-none-any.whl (6.0 kB view details)

Uploaded Python 3

File details

Details for the file encryptcode-0.1.1.tar.gz.

File metadata

  • Download URL: encryptcode-0.1.1.tar.gz
  • Upload date:
  • Size: 5.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for encryptcode-0.1.1.tar.gz
Algorithm Hash digest
SHA256 9361a2bbdb2269f33efa338bcad899af90842c911325b5d8177bf93f6911268a
MD5 b9f82f328c8c6215489dc08c47ceac84
BLAKE2b-256 809c6124b6869673b85eec1309d6468f7059e08172224d672a758a247647d216

See more details on using hashes here.

File details

Details for the file encryptcode-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: encryptcode-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 6.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for encryptcode-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3d61aed4516a293379e2883365fd0f4af4581fcdfebe6646ef9d00668b732745
MD5 75968af4a0c71f322afa463dd8af1c6b
BLAKE2b-256 57e73f96de4caa7f27b396c5a53dbd348f4625cf444b703eb60dfd8c45ae55ba

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page