Requirements
- Python 3.8+
- Flit to put Python packages and modules on PyPI
- Pydantic for the data parts.
Installation
pip install flit
pip install pyimporters-dummy
Publish the Python Package to PyPI
- Increment the version of your package in the
__init__.pyfile:
"""An amazing package!"""
__version__ = 'x.y.z'
- Publish
flit publish
Write your own pyimporters plugin
- Git clone the pyimporters_dummy project
git clone git@bitbucket.org:kairntech/pyimporters_dummy.git
- Rename the project with your own format name <new_format>
mv pyimporters_dummy pyimporters_<new_format>
- Delete the .git directory
rm -r -f pyimporters_<new_format>/.git
- Change to the new pyimporters_<new_format> directory
cd pyimporters_<new_format>
- Rename the package directory project
mv pyimporters_dummy pyimporters_<new_format>
- Rename the python file implementation
mv pyimporters_<new_format>/dummy.py pyimporters_<new_format>/<new_format>.py
- Rename the python tests file implementation
mv tests/test_dummy.py tests/test_<new_format>.py
- Edit the pyproject.toml file to change a few lines and add your additional requirements
[tool.flit.metadata]
module = "pyimporters_<new_format>"
...
requires = [
"pyimporters_plugins>=0.1.61",
"additional_requirement1",
"additional_requirement2",
...
"additional_requirementN",
]
dist-name = "pyimporters-<new_format>"
...
[tool.flit.entrypoints."pyimporters.plugins"]
<new_format> = "pyimporters_<new_format>.<new_format>:NewFormatKnowledgeParser"
- Write the implementation and test of your new format in python using your favorite IDE
@dataclass
class NewFormatOptions(KnowledgeParserOptions):
"""
Options for the new format knowledge import
"""
foo : str = Query("bar", description="Dummy parameter")
NewFormatOptionsModel = NewFormatOptions.__pydantic_model__
class NewFormatKnowledgeParser(KnowledgeParserBase):
def parse(self, source : Path, options: Union[KnowledgeParserOptions, Dict[str, Any]], bar : Bar) -> Generator[Term, None, None]:
options = NewFormatOptions(**options) if isinstance(options, dict) else options
# Initialize the progress indicator number of terms to read so that the progress indicator can send feedback to the end user
bar.max = 100
bar.start()
# yield as many terms as you want, advancing the progress indicator each time
bar.next()
yield Term(identifier=options.foo, preferredForm=options.foo)
# Terminate the progress indicator
bar.finish()
@classmethod
def get_schema(cls) -> KnowledgeParserOptions:
return NewFormatOptions
@classmethod
def get_model(cls) -> Type[BaseModel]:
return NewFormatOptionsModel
Metadata
Release files for pyimporters-dummy 0.1.306
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pyimporters-dummy-0.1.306.tar.gz | 5.5 kB | Without provenance | Details for pyimporters-dummy-0.1.306.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pyimporters_dummy-0.1.306-py3-none-any.whl | Python 3 | none | any | Details for pyimporters_dummy-0.1.306-py3-none-any.whl |
Total release size: 9.0 kB
Release files / pyimporters-dummy-0.1.306.tar.gz
| Download URL | pyimporters-dummy-0.1.306.tar.gz |
|---|---|
| Size | 5.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ee7bffc0fed21676843a973e0ce15f7a3fa275dcc1def2e581f7e8b0d1ef52b5
|
|
BLAKE2b-256 checksum How to use checksums |
1a99d9f71838f2be13e45f4f996d5277e1a2cfdb2ebfbf5f96daf51e3e566e09
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
python-requests/2.25.1
|
Release files / pyimporters_dummy-0.1.306-py3-none-any.whl
| Download URL | pyimporters_dummy-0.1.306-py3-none-any.whl |
|---|---|
| Size | 3.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
427f492a3bd29371f85abf76545013de7e6c28e4a6db545f0bca8cf05967729c
|
|
BLAKE2b-256 checksum How to use checksums |
2c6156699cb1a41ddb6e22d248e1406cd1fb288668d260c47f0e193cff99ff39
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
python-requests/2.25.1
|
Security for pyimporters-dummy 0.1.306
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.