{"id":15380832,"url":"https://github.com/skullzarmy/unfucker","last_synced_at":"2025-04-15T18:40:55.836Z","repository":{"id":203173445,"uuid":"708990489","full_name":"skullzarmy/unfucker","owner":"skullzarmy","description":"A Python utility to attempt to unfuck fucked up text files.","archived":false,"fork":false,"pushed_at":"2023-11-03T08:43:55.000Z","size":3970,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-03-28T23:43:48.661Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","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/skullzarmy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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":"2023-10-23T19:44:03.000Z","updated_at":"2024-05-02T18:04:46.000Z","dependencies_parsed_at":null,"dependency_job_id":"4c55141b-6eff-4a8b-8cd6-07809a38c38a","html_url":"https://github.com/skullzarmy/unfucker","commit_stats":{"total_commits":43,"total_committers":1,"mean_commits":43.0,"dds":0.0,"last_synced_commit":"c326e2348f16d3b82555d549f473b9126fc83bec"},"previous_names":["skullzarmy/unfucker"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skullzarmy%2Funfucker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skullzarmy%2Funfucker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skullzarmy%2Funfucker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skullzarmy%2Funfucker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/skullzarmy","download_url":"https://codeload.github.com/skullzarmy/unfucker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249130719,"owners_count":21217600,"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":[],"created_at":"2024-10-01T14:24:45.357Z","updated_at":"2025-04-15T18:40:55.817Z","avatar_url":"https://github.com/skullzarmy.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Unfucker\n\n```\n88        88                 ad88                           88\n88        88                d8\"                             88\n88        88                88                              88\n88        88  8b,dPPYba,  MM88MMM  88       88   ,adPPYba,  88   ,d8   ,adPPYba,  8b,dPPYba,\n88        88  88P'   `\"8a   88     88       88  a8\"     \"\"  88 ,a8\"   a8P_____88  88P'   \"Y8\n88        88  88       88   88     88       88  8b          8888[     8PP\"\"\"\"\"\"\"  88\nY8a.    .a8P  88       88   88     \"8a,   ,a88  \"8a,   ,aa  88`\"Yba,  \"8b,   ,aa  88\n `\"Y8888Y\"'   88       88   88      `\"YbbdP'Y8   `\"Ybbd8\"'  88   `Y8a  `\"Ybbd8\"'  88\n\n\n                                          @@@@@@\n                                        .@. ..#*@\n                                        @\u0026  ...*@\n                                        @. ....*@\n                                       @\u0026 .*,.**@\n                                       @. ....*/@\n                                @@@@@@#@. ....*\u0026@@**/@@@@@@@\n                          .@@@@@@@@***@@......*#..,***/*****@,\n                       .@#**(@@@#****\u0026@@,#\u0026@(.*\u0026@  .......**@@\n                       @,. ..,*%  ...*@.  ,,.,*@@****%@@.,**@%\n                      @@  ...*@. ....*@. ....**@. ....**@*(@\n                     @@. ...**/ .....*@. ....,*@. ....,*@/@\n                    @#@.....*@.......*\u0026 ......*@. ....,*@*@,\n                    @\u0026,....,*/......*/(.......*@*.....*#**@\n                    *@..............*,@......**..*....*%/@.\n                     ,@. ............................,*(@\n                       @@@@@@. .,.**................**@@\n                            .@@/(@@@,. ..**\u0026*. ...*@@,\n                                    @@@@@@@@\u0026@@@@@%\n _     _        ___             _                                    ___ _ _\n| |   | |      / __)           | |                                  / __|_) |\n| |   | |____ | |__ _   _  ____| |  _    _   _  ___  _   _  ____   | |__ _| | ____  ___\n| |   | |  _ \\|  __) | | |/ ___) | / )  | | | |/ _ \\| | | |/ ___)  |  __) | |/ _  )/___)\n| |___| | | | | |  | |_| ( (___| |\u003c (   | |_| | |_| | |_| | |      | |  | | ( (/ /|___ |\n \\______|_| |_|_|   \\____|\\____)_| \\_)   \\__  |\\___/ \\____|_|      |_|  |_|_|\\____|___/\n                                        (____/\n\n```\n\nUnfucker is a Python utility for repairing corrupted or malformed text files. It currently supports JSON, XML, and TXT formats. It provides functionalities to automatically fix syntax errors, missing attributes, or encoding issues in these files.\n\nIf you are looking to do a lot of unfucking, you may be interested in the [**Unfucker API**](https://github.com/skullzarmy/unfucker-api)\n\n[![SoCalTechLab.com logo - click to visit](./assets/sctl_xs_rounded_white_text.webp)](https://socaltechlab.com/?rel=unfuckerApiGitHubRepo)\n\n[a SoCalTechLab.com project](https://socaltechlab.com/?rel=unfuckerApiGitHubRepo)\n\nFeel free to send a few unfuck requests at my implementation here https://unfucker.socaltechlab.com/unfuck or try it out at [https://socaltechlab.com/utils/file-unfucker/](https://socaltechlab.com/utils/file-unfucker/)\n\n```bash\ncurl -X POST \"https://unfucker.socaltechlab.com/unfuck\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n        \"file_content\": \"{ \\\"key\\\": \\\"value\\\" }\"\n      }'\n```\n\n## 📜 License\n\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.\n\n## 🛠 Installation\n\nSince this package is not yet available on PyPI, you can install it locally by cloning the repository and using pip. Follow the steps below:\n\n1. Clone the repository:\n\n```bash\ngit clone https://github.com/skullzarmy/unfucker.git\n```\n\n2. Navigate to the project directory:\n\n```bash\ncd unfucker\n```\n\n3. Install the package locally:\n\n```bash\npip install -e .\n```\n\nBy using pip install -e ., you're performing an \"editable\" install, which means changes to the source code will immediately affect the installed package without needing a reinstallation.\n\nNow, you can import the package in your Python scripts without having to manipulate your PYTHONPATH.\n\n## Dependencies\n\nThe project dependencies are listed in the requirements.txt file. To install them, run the following command:\n\n```bash\npip install -r requirements.txt\n```\n\n## 🎈 Usage\n\n### 📄 Importing into a Script\n\nTo use Unfucker in a Python script, simply import the class and use it as follows:\n\n```python\nfrom Unfucker import Unfucker, unfuck\n\nfile_path = \"path/to/your/file.json\"\noutput_path = \"path/to/save/fixed/file.json\"\n\n# Initialize the Unfucker\nunfucker = Unfucker(file_path)\n\n# Unfuck the file\nfixed_content, error = unfucker.unfuck()\n\nif fixed_content:\n    # Save to a file or use fixed_content as you see fit\n    unfucker.save_to_file(str(fixed_content), output_path, True)\nelse:\n    print(f\"Could not unfuck the file: {error}\")\n```\n\n### 🛠️ Command-Line Interface\n\nAlternatively, you can run the script from the command line:\n\n```bash\nunfucker path/to/your/file.json -o path/to/save/fixed/file.json --overwrite\n```\n\n```bash\npython path/to/unfucker.py path/to/your/file.json -o path/to/save/fixed/file.json --overwrite\n```\n\n-   `path/to/your/file.json` is the path to the file you want to fix.\n-   `-o path/to/save/fixed/file.json` specifies where to save the fixed content.\n-   `--overwrite` allows you to overwrite the output file if it already exists.\n\n### 🛜 API\n\n[**Unfucker API**](https://github.com/skullzarmy/unfucker-api) inherits the capability to automatically fix syntax errors, missing attributes, or encoding issues in your files. Crafted with Flask and optimized for Docker, this API is perfect for those looking to add automated unfucking to their tech stacks.\n\n## 🧪 Running Tests\n\nThis project uses pytest for testing. To run the tests locally, you'll need to install pytest if you haven't already:\n\n```bash\npip install pytest\n```\n\nOnce pytest is installed, navigate to the project directory and run the following command:\n\n```bash\npytest\n```\n\nThis will discover and run all the test cases in the project. If everything is set up correctly, you should see output indicating the number of passed tests.\n\n## 🤝 Contributing to Unfucker Python Package\n\nHey there, awesome human! Interested in contributing to Unfucker? That's fuckin' great! 🎉 Before you dive into the code, make sure to read our [Contributing Guidelines](./CONTRIBUTING.md) and our rather entertaining [Code of Conduct](./CODE_OF_CONDUCT.md).\n\nWhether it's submitting a bug report, proposing a new feature, or creating a pull request, every contribution is valuable and appreciated. 🙏\n\nLet's build something badass together! 👩‍💻👨‍💻\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskullzarmy%2Funfucker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fskullzarmy%2Funfucker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskullzarmy%2Funfucker/lists"}