paaaaath


Namepaaaaath JSON
Version 0.2.7 PyPI version JSON
download
home_pagehttps://github.com/ar90n/paaaaath
Summarya useful alternative Path object
upload_time2023-04-19 15:21:57
maintainer
docs_urlNone
authorMasahiro Wada
requires_python>=3.7,<3.11
licenseMIT
keywords path s3 gcs cloud
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            [![Build][build-shiled]][build-url]
[![Version][version-shield]][version-url]
[![Downloads][download-shield]][download-url]
[![Contributors][contributors-shield]][contributors-url]
[![Forks][forks-shield]][forks-url]
[![Stargazers][stars-shield]][stars-url]
[![Issues][issues-shield]][issues-url]
[![MIT License][license-shield]][license-url]




## About The Project

This project is motivated to provide a useful alternative Path object.

### Built With

- [poetry](https://python-poetry.org/)

## Getting Started

```sh
$ pip install paaaaath
$ python -c "from paaaaath import Path; print(Path('https://raw.githubusercontent.com/ar90n/paaaaath/main/assets/python_logo.txt').read_text())"
                   _.gj8888888lkoz.,_
                d888888888888888888888b,
               j88P""V8888888888888888888
               888    8888888888888888888
               888baed8888888888888888888
               88888888888888888888888888
                            8888888888888
    ,ad8888888888888888888888888888888888  888888be,
   d8888888888888888888888888888888888888  888888888b,
  d88888888888888888888888888888888888888  8888888888b,
 j888888888888888888888888888888888888888  88888888888p,
j888888888888888888888888888888888888888'  8888888888888
8888888888888888888888888888888888888^"   ,8888888888888
88888888888888^'                        .d88888888888888
8888888888888"   .a8888888888888888888888888888888888888
8888888888888  ,888888888888888888888888888888888888888^
^888888888888  888888888888888888888888888888888888888^
 V88888888888  88888888888888888888888888888888888888Y
  V8888888888  8888888888888888888888888888888888888Y
   `"^8888888  8888888888888888888888888888888888^"'
               8888888888888
               88888888888888888888888888
               8888888888888888888P""V888
               8888888888888888888    888
               8888888888888888888baed88V
                `^888888888888888888888^
                  `'"^^V888888888V^^'
```

### Prerequisites

If you rune some codes in this repository, you have to install poetry as following.

```sh
pip install poetry
```

### Installation

```sh
pip install paaaaath
```

## Usage

```python
from paaaaath import Path

OUTPUT_BUCKET = ""  # fill output bucket name


def main():
    png_images = []
    for p in Path("s3://elevation-tiles-prod/normal/10/963").iterdir():
        if p.suffix != ".png":
            continue

        png_images.append(p)
        if 3 < len(png_images):
            break

    for input_path in png_images:
        if OUTPUT_BUCKET != "":
            output_path = Path(f"s3://{OUTPUT_BUCKET}/{input_path.name}")
            print(f"upload {output_path.name} to {output_path}")
            output_path.write_bytes(p.read_bytes())
        else:
            print(f"skip upload {input_path.name}")


if __name__ == "__main__":
    main()
```

## Featuers
| | HttpPath | S3Path| GCSPath |
| :-------------: | :-------------: | :-------------: | :-------------: |
| open | ✅ | ✅ | ✅ |
| read_text | ✅ | ✅ | ✅ |
| read_byte | ✅ | ✅ | ✅ |
| write_text | ❌ | ✅ | ✅ |
| write_byte | ❌ | ✅ | ✅ |
| iterdir | ❌ | ✅ | ✅ |
| touch | ❌ | ✅ | ✅ |
| mkdir | ❌ | ✅ | ✅ |
| exists | ❌ | ✅ | ✅ |


## Roadmap

See the [open issues](https://github.com/ar90n/paaaaath/issues) for a list of proposed features (and known issues).

## Contributing

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are **greatly appreciated**.

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

## License

Distributed under the MIT License. See `LICENSE` for more information.

## Contact

Masahiro Wada - [@ar90n](https://twitter.com/ar90n) - argon.argon.argon@gmail.com

Project Link: [https://github.com/ar90n/paaaaath](https://github.com/ar90n/paaaaath)

## Acknowledgements

- [smart-open](https://pypi.org/project/smart-open/)
- [Python Logo](https://ascii.matthewbarber.io/art/python/)

<!-- MARKDOWN LINKS & IMAGES -->
<!-- https://www.markdownguide.org/basic-syntax/#reference-style-links -->

[download-shield]: https://img.shields.io/pypi/dm/paaaaath?style=for-the-badge
[download-url]: https://pypi.org/project/paaaaath/
[version-shield]: https://img.shields.io/pypi/v/paaaaath?style=for-the-badge
[version-url]: https://pypi.org/project/paaaaath/
[build-shiled]: https://img.shields.io/github/actions/workflow/status/ar90n/paaaaath/ci.yml?style=for-the-badge
[build-url]: https://github.com/ar90n/paaaaath/actions/workflows/ci.yml
[contributors-shield]: https://img.shields.io/github/contributors/ar90n/paaaaath.svg?style=for-the-badge
[contributors-url]: https://github.com/ar90n/paaaaath/graphs/contributors
[forks-shield]: https://img.shields.io/github/forks/ar90n/paaaaath.svg?style=for-the-badge
[forks-url]: https://github.com/ar90n/paaaaath/network/members
[stars-shield]: https://img.shields.io/github/stars/ar90n/paaaaath.svg?style=for-the-badge
[stars-url]: https://github.com/ar90n/paaaaath/stargazers
[issues-shield]: https://img.shields.io/github/issues/ar90n/paaaaath.svg?style=for-the-badge
[issues-url]: https://github.com/ar90n/paaaaath/issues
[license-shield]: https://img.shields.io/github/license/ar90n/paaaaath.svg?style=for-the-badge
[license-url]: https://github.com/ar90n/paaaaath/blob/main/LICENSE.txt

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/ar90n/paaaaath",
    "name": "paaaaath",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7,<3.11",
    "maintainer_email": "",
    "keywords": "path,s3,gcs,cloud",
    "author": "Masahiro Wada",
    "author_email": "argon.argon.argon@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/3b/9c/7a6154219b67e8231370caa4da3fe1e80a2caa8c645f2c9ae3b3cea4cdc7/paaaaath-0.2.7.tar.gz",
    "platform": null,
    "description": "[![Build][build-shiled]][build-url]\n[![Version][version-shield]][version-url]\n[![Downloads][download-shield]][download-url]\n[![Contributors][contributors-shield]][contributors-url]\n[![Forks][forks-shield]][forks-url]\n[![Stargazers][stars-shield]][stars-url]\n[![Issues][issues-shield]][issues-url]\n[![MIT License][license-shield]][license-url]\n\n\n\n\n## About The Project\n\nThis project is motivated to provide a useful alternative Path object.\n\n### Built With\n\n- [poetry](https://python-poetry.org/)\n\n## Getting Started\n\n```sh\n$ pip install paaaaath\n$ python -c \"from paaaaath import Path; print(Path('https://raw.githubusercontent.com/ar90n/paaaaath/main/assets/python_logo.txt').read_text())\"\n                   _.gj8888888lkoz.,_\n                d888888888888888888888b,\n               j88P\"\"V8888888888888888888\n               888    8888888888888888888\n               888baed8888888888888888888\n               88888888888888888888888888\n                            8888888888888\n    ,ad8888888888888888888888888888888888  888888be,\n   d8888888888888888888888888888888888888  888888888b,\n  d88888888888888888888888888888888888888  8888888888b,\n j888888888888888888888888888888888888888  88888888888p,\nj888888888888888888888888888888888888888'  8888888888888\n8888888888888888888888888888888888888^\"   ,8888888888888\n88888888888888^'                        .d88888888888888\n8888888888888\"   .a8888888888888888888888888888888888888\n8888888888888  ,888888888888888888888888888888888888888^\n^888888888888  888888888888888888888888888888888888888^\n V88888888888  88888888888888888888888888888888888888Y\n  V8888888888  8888888888888888888888888888888888888Y\n   `\"^8888888  8888888888888888888888888888888888^\"'\n               8888888888888\n               88888888888888888888888888\n               8888888888888888888P\"\"V888\n               8888888888888888888    888\n               8888888888888888888baed88V\n                `^888888888888888888888^\n                  `'\"^^V888888888V^^'\n```\n\n### Prerequisites\n\nIf you rune some codes in this repository, you have to install poetry as following.\n\n```sh\npip install poetry\n```\n\n### Installation\n\n```sh\npip install paaaaath\n```\n\n## Usage\n\n```python\nfrom paaaaath import Path\n\nOUTPUT_BUCKET = \"\"  # fill output bucket name\n\n\ndef main():\n    png_images = []\n    for p in Path(\"s3://elevation-tiles-prod/normal/10/963\").iterdir():\n        if p.suffix != \".png\":\n            continue\n\n        png_images.append(p)\n        if 3 < len(png_images):\n            break\n\n    for input_path in png_images:\n        if OUTPUT_BUCKET != \"\":\n            output_path = Path(f\"s3://{OUTPUT_BUCKET}/{input_path.name}\")\n            print(f\"upload {output_path.name} to {output_path}\")\n            output_path.write_bytes(p.read_bytes())\n        else:\n            print(f\"skip upload {input_path.name}\")\n\n\nif __name__ == \"__main__\":\n    main()\n```\n\n## Featuers\n| | HttpPath | S3Path| GCSPath |\n| :-------------: | :-------------: | :-------------: | :-------------: |\n| open | \u2705 | \u2705 | \u2705 |\n| read_text | \u2705 | \u2705 | \u2705 |\n| read_byte | \u2705 | \u2705 | \u2705 |\n| write_text | \u274c | \u2705 | \u2705 |\n| write_byte | \u274c | \u2705 | \u2705 |\n| iterdir | \u274c | \u2705 | \u2705 |\n| touch | \u274c | \u2705 | \u2705 |\n| mkdir | \u274c | \u2705 | \u2705 |\n| exists | \u274c | \u2705 | \u2705 |\n\n\n## Roadmap\n\nSee the [open issues](https://github.com/ar90n/paaaaath/issues) for a list of proposed features (and known issues).\n\n## Contributing\n\nContributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are **greatly appreciated**.\n\n1. Fork the Project\n2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)\n3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`)\n4. Push to the Branch (`git push origin feature/AmazingFeature`)\n5. Open a Pull Request\n\n## License\n\nDistributed under the MIT License. See `LICENSE` for more information.\n\n## Contact\n\nMasahiro Wada - [@ar90n](https://twitter.com/ar90n) - argon.argon.argon@gmail.com\n\nProject Link: [https://github.com/ar90n/paaaaath](https://github.com/ar90n/paaaaath)\n\n## Acknowledgements\n\n- [smart-open](https://pypi.org/project/smart-open/)\n- [Python Logo](https://ascii.matthewbarber.io/art/python/)\n\n<!-- MARKDOWN LINKS & IMAGES -->\n<!-- https://www.markdownguide.org/basic-syntax/#reference-style-links -->\n\n[download-shield]: https://img.shields.io/pypi/dm/paaaaath?style=for-the-badge\n[download-url]: https://pypi.org/project/paaaaath/\n[version-shield]: https://img.shields.io/pypi/v/paaaaath?style=for-the-badge\n[version-url]: https://pypi.org/project/paaaaath/\n[build-shiled]: https://img.shields.io/github/actions/workflow/status/ar90n/paaaaath/ci.yml?style=for-the-badge\n[build-url]: https://github.com/ar90n/paaaaath/actions/workflows/ci.yml\n[contributors-shield]: https://img.shields.io/github/contributors/ar90n/paaaaath.svg?style=for-the-badge\n[contributors-url]: https://github.com/ar90n/paaaaath/graphs/contributors\n[forks-shield]: https://img.shields.io/github/forks/ar90n/paaaaath.svg?style=for-the-badge\n[forks-url]: https://github.com/ar90n/paaaaath/network/members\n[stars-shield]: https://img.shields.io/github/stars/ar90n/paaaaath.svg?style=for-the-badge\n[stars-url]: https://github.com/ar90n/paaaaath/stargazers\n[issues-shield]: https://img.shields.io/github/issues/ar90n/paaaaath.svg?style=for-the-badge\n[issues-url]: https://github.com/ar90n/paaaaath/issues\n[license-shield]: https://img.shields.io/github/license/ar90n/paaaaath.svg?style=for-the-badge\n[license-url]: https://github.com/ar90n/paaaaath/blob/main/LICENSE.txt\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "a useful alternative Path object",
    "version": "0.2.7",
    "split_keywords": [
        "path",
        "s3",
        "gcs",
        "cloud"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "aeed4d9b83372d8be804de13ad5ae1d970645febec112fc268a8cc26cf6abd12",
                "md5": "0b9de72292e40e7e58e8dab5aa8f7ec9",
                "sha256": "c95ddf3f4800818161e1a0488acdf34584f368f8b6d6b72edb75ced6d4e0f5cc"
            },
            "downloads": -1,
            "filename": "paaaaath-0.2.7-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "0b9de72292e40e7e58e8dab5aa8f7ec9",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7,<3.11",
            "size": 10813,
            "upload_time": "2023-04-19T15:21:55",
            "upload_time_iso_8601": "2023-04-19T15:21:55.116616Z",
            "url": "https://files.pythonhosted.org/packages/ae/ed/4d9b83372d8be804de13ad5ae1d970645febec112fc268a8cc26cf6abd12/paaaaath-0.2.7-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "3b9c7a6154219b67e8231370caa4da3fe1e80a2caa8c645f2c9ae3b3cea4cdc7",
                "md5": "69bb26d8256d7edf55a97571632ff3c2",
                "sha256": "04c2c213bcab1d549063a44258fb6625584ca34f432511eaea2ee2515a080959"
            },
            "downloads": -1,
            "filename": "paaaaath-0.2.7.tar.gz",
            "has_sig": false,
            "md5_digest": "69bb26d8256d7edf55a97571632ff3c2",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7,<3.11",
            "size": 9888,
            "upload_time": "2023-04-19T15:21:57",
            "upload_time_iso_8601": "2023-04-19T15:21:57.141492Z",
            "url": "https://files.pythonhosted.org/packages/3b/9c/7a6154219b67e8231370caa4da3fe1e80a2caa8c645f2c9ae3b3cea4cdc7/paaaaath-0.2.7.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-04-19 15:21:57",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "ar90n",
    "github_project": "paaaaath",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "paaaaath"
}
        
Elapsed time: 0.09209s