Git Product home page Git Product logo

poe-filter-tools's Introduction

PoE-Filter-Stuff

Tools to help with my Path of Exile filter creation. Work in Progress.

Overview

  • extract_table_data.py

This is a script that extracts data from HTML tables in a specific URL using the PyQuery library. The script loops through all the tables in the webpage, extracts data from each table, and saves the data to separate JSON files using the built-in json library. The data is returned as a list of dictionaries, where each dictionary represents a row in the table, with keys representing column headers and values representing the data in the corresponding cells.

  • parse_json_to_txt.py

The script defines a function parse_json_to_txt that reads in a JSON file, extracts specific fields, and writes the extracted information to a text file in a specific format. The function takes in two arguments, the file path of the JSON file to parse and the file path of the output text file. It returns None. The function is then called in a loop to parse multiple JSON files and write the extracted data to separate text files. The function handles errors related to file not found, invalid JSON, and other exceptions. The output text file contains a formatted string for each item in the JSON file.

ToDo-List

See what has to be done and contribute if you wish to do so.

Contribute

Whether you're a seasoned developer or just getting started, there are plenty of ways you can help out. If you notice any bugs or have any feature requests, please open an issue on the repository. This helps me keep track of what needs to be fixed or improved. If you want to contribute code directly, you can do so by opening a pull request.

Changelog

Button Changelog

poe-filter-tools's People

Contributors

chelyocarpus avatar

Watchers

 avatar

poe-filter-tools's Issues

Change output.json

Change the name of the output file to the type of gear it includes instead of using a generic name for all.

Optimize extraction of table rows

for i in range(1, amount_of_items+1):
        # Extract the name of the item from the first column
        name_of_item = rows.eq(i).find('td span span a').attr("title")
        
        # Extract the required level from the second column
        req_level = rows.eq(i).find('td:nth-child(2)').text()

        # Extract the required attributes from the third column
        third_column = rows.eq(i).find('td:nth-child(3)').text()

        # Extract the values from the fourth column
        fourth_column = rows.eq(i).find('td:nth-child(4)').text()

        # Extract the values from the fifth column
        fifth_column = rows.eq(i).find('td:nth-child(5)').text()

        # Extract the values from the sixth column
        sixth_column = rows.eq(i).find('td:nth-child(6)').text()

        # Append the item data to the list of items
        items.append({'name': name_of_item, 'req_level': req_level, '3': third_column, '4': fourth_column, '5': fifth_column, '6': sixth_column})

    return items

Change to loop

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.