{"id":24890409,"url":"https://github.com/mahirshah07/pynextcloud","last_synced_at":"2025-03-27T12:44:17.723Z","repository":{"id":275271256,"uuid":"925587490","full_name":"MahirShah07/pyNextcloud","owner":"MahirShah07","description":"A Python library for interacting with Nextcloud via WebDAV","archived":false,"fork":false,"pushed_at":"2025-02-01T09:23:07.000Z","size":17,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-01T10:23:53.283Z","etag":null,"topics":["library","nextcloud","pypi"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/pyNextcloud/","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MahirShah07.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-02-01T08:18:45.000Z","updated_at":"2025-02-01T09:23:10.000Z","dependencies_parsed_at":"2025-02-01T10:34:07.457Z","dependency_job_id":null,"html_url":"https://github.com/MahirShah07/pyNextcloud","commit_stats":null,"previous_names":["mahirshah07/pynextcloud"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MahirShah07%2FpyNextcloud","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MahirShah07%2FpyNextcloud/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MahirShah07%2FpyNextcloud/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MahirShah07%2FpyNextcloud/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MahirShah07","download_url":"https://codeload.github.com/MahirShah07/pyNextcloud/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245850248,"owners_count":20682636,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["library","nextcloud","pypi"],"created_at":"2025-02-01T17:15:25.131Z","updated_at":"2025-03-27T12:44:17.591Z","avatar_url":"https://github.com/MahirShah07.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pyNextcloud\r\n\r\n`pyNextcloud` is a Python library for interacting with Nextcloud via WebDAV. It provides functions to upload, download, rename, delete files and directories, and check for directory existence.\r\n\r\n## Features\r\n\r\n- Upload files and folders to Nextcloud\r\n- Download files from Nextcloud\r\n- Rename or move files and directories\r\n- Delete files and directories\r\n- Check if a directory exists\r\n- Configuration using environment variables or a `.env` file\r\n\r\n## Installation\r\n\r\nTo install `pyNextcloud`, use pip:\r\n\r\n```bash\r\npip install pyNextcloud\r\n```\r\n\r\n## Configuration\r\n\r\nTo store the `NEXTCLOUD_URL`, `USERNAME`, and `PASSWORD` securely in your library, you can make use of environment variables or a configuration file to keep them safe and accessible in your app. Here's how you can do both:\r\n\r\n### 1. **Using Environment Variables** (Recommended for security)\r\n\r\nYou can store these sensitive values in environment variables, so they aren't hardcoded in your source code.\r\n\r\n#### Steps:\r\n\r\n- Set up environment variables on your system or in your deployment environment:\r\n  - On Unix/Linux/Mac:\r\n    ```bash\r\n    export NEXTCLOUD_URL=\"your_nextcloud_url\"\r\n    export USERNAME=\"your_username\"\r\n    export PASSWORD=\"your_password\"\r\n    ```\r\n\r\n  - On Windows:\r\n    ```cmd\r\n    set NEXTCLOUD_URL=\"your_nextcloud_url\"\r\n    set USERNAME=\"your_username\"\r\n    set PASSWORD=\"your_password\"\r\n    ```\r\n\r\n### 2. **Using a Configuration File** (Not as secure as environment variables)\r\n\r\nIf you'd rather use a configuration file, you can store them in a `.env` or JSON file.\r\n\r\n#### `.env` File Example:\r\n\r\n- Create a `.env` file:\r\n  ```\r\n  NEXTCLOUD_URL=your_nextcloud_url\r\n  USERNAME=your_username\r\n  PASSWORD=your_password\r\n  ```\r\n\r\n## Usage\r\n\r\n### Upload a File\r\n\r\n```python\r\nfrom pyNextcloud.nextcloud import UploadFile\r\n\r\nUploadFile('local_path.txt', 'remote_path.txt')\r\n```\r\n\r\n### Download a File\r\n\r\n```python\r\nfrom pyNextcloud.nextcloud import DownloadFile\r\n\r\nDownloadFile('local_path.txt', 'remote_path.txt')\r\n```\r\n\r\n### Check if a Directory Exists\r\n\r\n```python\r\nfrom pyNextcloud.nextcloud import DirectoryExists_Check\r\n\r\nresult = DirectoryExists_Check('remote_directory')\r\nprint(result)\r\n```\r\n\r\n### Create a Directory\r\n\r\n```python\r\nfrom pyNextcloud.nextcloud import CreateDirectory\r\n\r\nresult = CreateDirectory('new_directory')\r\nprint(result)\r\n```\r\n\r\n### Rename or Move a File/Directory\r\n\r\n```python\r\nfrom pyNextcloud.nextcloud import RenamePath\r\n\r\nresult = RenamePath('current_path.txt', 'new_path.txt')\r\nprint(result)\r\n```\r\n\r\n### Delete a File/Directory\r\n\r\n```python\r\nfrom pyNextcloud.nextcloud import DeletePath\r\n\r\nresult = DeletePath('target_path.txt')\r\nprint(result)\r\n```\r\n\r\n### Upload a Folder\r\n\r\n```python\r\nfrom pyNextcloud.nextcloud import UploadFolder\r\n\r\nresult = UploadFolder('local_folder', 'remote_folder')\r\nprint(result)\r\n```\r\n\r\n## Running Tests\r\n\r\nTo run the tests, use the following command:\r\n\r\n```bash\r\npython -m unittest discover -s tests\r\n```\r\n\r\n## License\r\n\r\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\r\n\r\n## Contributing\r\n\r\nContributions are welcome! Please open an issue or submit a pull request for any changes.\r\n\r\n## Acknowledgements\r\n\r\n- [Nextcloud](https://nextcloud.com/) for providing the WebDAV interface.\r\n- [Requests](https://docs.python-requests.org/en/master/) for making HTTP requests simple.\r\n- [python-dotenv](https://github.com/theskumar/python-dotenv) for managing environment variables.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmahirshah07%2Fpynextcloud","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmahirshah07%2Fpynextcloud","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmahirshah07%2Fpynextcloud/lists"}