Skip to main content

A tool for working with serialized data

Project description

Contributors Forks Stargazers Issues GNU License LinkedIn


SerialPy 0.1.0

Precision Data Format Manager · Report Bug · Request Feature

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. Tasks
  5. Contributing
  6. License
  7. Contact
  8. Acknowledgments

About The Project

SerialPy is a Python package designed to streamline search and replace operations on data formats: yaml, toml, and json. Built to use with additional shell scripting to semi-automate workflows involving OpenAPI and Swagger files, making it ideal for companies aiming to maintain consistency within their specification sheets. Features include search and replace, allowing for precise control of serial data. SerialPy empowers users to ensure accuracy and reliability, making it an invaluable tool for specification sheet maintenance.

(back to top)

Getting Started

Installation

Simply run:

pip install SerialPy

(back to top)

Usage

Serialpy supports the -h flag at the main and all subcommands so more details can be found there.

Command-Line Interface (CLI)

Search for any key within the data in the given file path that is "test" and return a list of values associated with the key.

serialpy search path/to/file "test" --find="key" --ret="value"

Replace any instance of "var1" from the data in the given file path to "var2" and return True if successfully written back to the file.

serialpy replace path/to/file "var1" "var2"

Library

Import the module at the top of your python script.

The following snippet of code runs search on all values in "path/to/file" for 5 and returns all keys associated with the value, 5.

The next line checks to see if the replace function successfully converted all instances of 5 in "path/to/file" with 6 and wrote the changes back into the file.

from serialpy import search, replace

found = search.values("path/to/file", "5", "keys") # add False as last argument to disable console printing
if (replace.all("path/to/file", "5", "6"):
  # code to run after successfully replacing 5 with 6

(back to top)

Tasks

  • Add replace feature
  • Add support for .toml
  • Update README.md
  • search and replace contained within a Cereal object that stores serial data
  • Add support for multiple documents at once
  • Add project parser to automatically insert supported file types

See the open issues for a full list of issues and proposed features.

(back to top)

Contributing

  1. Fork the Project
  2. Create your Feature/Update Branch (git checkout -b feature/NewFeature or git checkout -b update/Feature)
  3. Commit your Changes (git commit -m 'Add some Feature')
  4. Push to the Branch (git push origin feature/NewFeature or git push origin update/Feature)
  5. Open a Pull Request

(back to top)

License

Distributed under the GPL-3.0 License. See LICENSE.txt for more information.

(back to top)

Contact

Michael Montanaro - LinkedIn - mcmontanaro01@gmail.com

Project Link: https://github.com/montymi/SerialPy

(back to top)

Acknowledgments

(back to top)

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

SerialPy-0.1.0.tar.gz (46.4 kB view details)

Uploaded Source

Built Distribution

SerialPy-0.1.0-py3-none-any.whl (32.9 kB view details)

Uploaded Python 3

File details

Details for the file SerialPy-0.1.0.tar.gz.

File metadata

  • Download URL: SerialPy-0.1.0.tar.gz
  • Upload date:
  • Size: 46.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for SerialPy-0.1.0.tar.gz
Algorithm Hash digest
SHA256 a4c45ca18203064983857d2f5c6a9aca8a2a9db72c2ba68d4f190a9a5c9eae5f
MD5 35e95154f383cd2027a6c2b38bc27fe9
BLAKE2b-256 619bd23d2871fe97f499923247158642a2734c58e3e18067abfb5d7c5486d8af

See more details on using hashes here.

File details

Details for the file SerialPy-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: SerialPy-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 32.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for SerialPy-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a7f39a13ba54057f9593d56060171c1f42d003cea43100fc8b6e8a39e4964d5d
MD5 046df284639d558f417720925ce38b06
BLAKE2b-256 a64fd823283c78e5547b73d32f2abbc64dfbeb169f4a887f0b3a1fcdacc680a0

See more details on using hashes here.

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