Skip to main content

A small example package

Project description

Test Package

This is a simple example of how to create a Python package.

Installation

Run pip install yidas-TestPackage

Structure

packaging_tutorial/
├── LICENSE
├── pyproject.toml
├── README.md
├── src/
│   └── TestPackage_yidas/
│       ├── __init__.py
│       └── example.py
└── tests/

example.py:

def greet():
    return "Hello, world!"

TestClass.py:

class TestClass:
    def greet(self):
        return "Hello, world!"

__init__.py:

# Autoload (TestClass.TestClass => TestClass)
from .TestClass import TestClass

pyproject.toml

[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[project]
name = "TestPackage_yidas"
...

Usage

from TestPackage_yidas import example
from TestPackage_yidas import TestClass

print(example.greet())
obj = TestClass()
print(obj.greet())

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

testpackage_yidas-0.0.6.tar.gz (1.4 kB view hashes)

Uploaded Source

Built Distribution

testpackage_yidas-0.0.6-py3-none-any.whl (2.1 kB view hashes)

Uploaded Python 3

Supported by

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