Skip to main content

Interface2.py

A very starting implementation of typescript interfaces in python! I was not satisfied with the dataclasses in python, so I attempted to make something similar to typescript interfaces !! My original plan was to do something like typechat in python, but I realized I needed something better than dataclasses.

The decorators are used to add more functionality to the code. The two current ones are one to make the interface immutable and the other to make it able to take multiple types as a type. I am expecting a TON of bugs, so please lmk if there are any!

To use it, you can clone the repo and then import the IF4 (the main file).

Then, you could do the following:

@multiple
class MyInterface(IF4.Interface):
    _properties = {
        "name": str,
        "age": (int, float)
    }

You could wrap them with the decorators too! IF you have ANY questions, please leave an issue and ill be happy to get back to you.

This is one of my first public projects! If anyone has any suggestions for changes/improvements/anything please let me know!!

please see the examples folder for examples of how to use it

Release files for Interface2-py-ashersopro2 0.0.1

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

Source distribution (sdist)

Source distribution for Interface2-py-ashersopro2 0.0.1
File Size Uploaded
Interface2_py_ashersopro2-0.0.1.tar.gz 8.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for Interface2-py-ashersopro2 0.0.1
File Interpreter ABI Platform
Interface2_py_ashersopro2-0.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 19.7 kB

Release files / Interface2_py_ashersopro2-0.0.1.tar.gz

Download URL Interface2_py_ashersopro2-0.0.1.tar.gz
Size 8.7 kB
Tags Source
SHA-256 checksum
How to use checksums
3e563b2eee1b663b7ed5aa6789e85b79c65cbe39c003007ace4c019591bcf85e
BLAKE2b-256 checksum
How to use checksums
7c09bcd95115ba9dc5eafb47535b3d2673001b49779024dd5ba06dd401efd0e1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.1

Release files / Interface2_py_ashersopro2-0.0.1-py3-none-any.whl

Download URL Interface2_py_ashersopro2-0.0.1-py3-none-any.whl
Size 11.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cc63bc5eca8c0585901769b1143d9cdafb9a8ea2ee1336f9a15a27215377b5f7
BLAKE2b-256 checksum
How to use checksums
3c9610f260705125386a40557aa0f2b381bdee01706b8d4b00211d1064f5ec29
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.1

Release history Release notifications | RSS feed

This release

0.0.1 This release

2 release files

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