Milestone
This is useful for XML files containing multiple hierarchies.
Example
One example is an XML dialect called TEI which might have been created to represent a book using chapters (div elements) but you want to use the text by page (pb element).
Imagine an XML file called myfile.xml that contains milestone elements <pb/> dotted throughout the XML.
The following command will split the input file into separate output files for each pb element:
python3 milestone.py -t pb myfile.xml
Or if you have installed the module through pip, you can use:
python3 -m milestone -b pb myfile.xml
The above commands will name the output files with integers.
Now imagine that the <pb> elements have an attribute called ‘n’ that we want to use for the name of each output file.
The following command will split the input file into separate output files, named according to the ‘n’ attribute:
python3 milestone.py -t pb -n n myfile.xml
If you want to transform the hierarchy but not split the data into separate files, you can use the -x flag:
python3 milestone.py -x -t pb -n n myfile.xml > outputfile.xml
To use this as a library in your own code, import the Milestone class:
from milestone import Milestone
To share ideas or improvements, please visit the github project at:
Metadata
Release files for milestone 0.2
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 | |
|---|---|---|---|---|
| milestone-0.2.tar.gz | 5.0 kB | Without provenance | Details |
Release files / milestone-0.2.tar.gz
| Download URL | milestone-0.2.tar.gz |
|---|---|
| Size | 5.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5234711acd6e4f5c6cfe8c8a432ddd6dc9cc3f95338c9e244838a81cd1d1e8e1
|
|
BLAKE2b-256 checksum How to use checksums |
e7a500ece4f17e66124a1d9338abd4b8fb8e7f877a2cc3bbda2889b67d5f44dd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for milestone 0.2
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.