Coder Social home page Coder Social logo

pydocparser's Introduction

Hi, My Name Is Steve Tautonico!


I'm a software engineer that specializes in web development and penetration testing.

// environment.ts
export const environment = {
    production: true,
    name: "Steve Tautonico",
    job: "software engineer",
    interests: ["web development", "pen testing", "mobile development", "networking", "it", "homelabs"],
    technologies: {
        languages: ["python", "javascript", "typescript", "java", "dart", "css", "less", "html", "rust", "c++", "c"],
        runTimes: ["nodejs", "deno"],
        frontend: {
            js: ["typescript", "javascript", "jquery"],
            css: ["materialize", "bootstrap", "fontawesome"],
            frameworks: ["angular", "vue"]
        },
        backend: {
            frameworks: ["django", "express", "oak"],
            databases: ["mongodb", "mysql", "sqlite"]
        },
        mobile: ["native script", "angular", "flutter"],
        devops: ["aws", "nginx", "gcp", "selfhost", "digitalocean", "github actions", "webpack"],
        misc: ["redis"]
    },
    currentOS: "Arch Linux",
    currentDE: "SDDM + i3"
    pgpKey: "https://stautonico.keybase.pub/public_pgp.txt",
    social: {
        "website": "https://dotslashsteve.sh/",
        "github": "https://github.com/stautonico/",
        "keybase": "https://keybase.io/stautonico",
        "email": "[email protected]"
    }
};

Steve's Github Status

Top Langs

pydocparser's People

Contributors

ngchinhow avatar stautonico avatar thomasmonnier avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

pydocparser's Issues

Use include_children parameter to obtain parsing results of documents created by splitting procedure

Hi,
I am using DocParser with some preprocessing on a parser (PARSER > Settings > Preprocessing), more specifically the splitting procedure (Split documents when importing). I use it to split a document if DocParser spots that there are many invoices in the same file. This splitting procedure is linked to the argument include_children. I have to put it to True, otherwise I can't use pydocparser on my model.

When using pydocparser, I can't actually use the include_children parameter, which raises an error when calling get_one_result().

{'error': 'Document was replaced by splitting procedure. Use include_children parameter to obtain parsing results of documents created by splitting procedure.'}

SOLUTION:
I have successfully modified the code to welcome the include_children parameter. See below.

def get_one_result(self, parser_label: str, document_id: str, include_children: Optional[boolean]=False) -> Union[str, dict]:
        """
        Get a specific document result from the given parser by document_id

        :param parser_label: The label of the parser to retrieve the document result from
        :param document_id: The id of the document to receive
        :return: A string error message or a dict containing the document result
        """
        parser_id = self._find_parser_id(parser_label)

        if not parser_id:
            return "Unable to find parser"

        if include_children:
            include_children_param = "/?include_children=true/"
        else:
            include_children_param = ""
        
        result = requests.get(self.BASE_URL + "/results/{}/{}{}".format(parser_id, document_id, include_children_param), auth=self.AUTH)

        # This needs its own error checking because status 400 isn't always a bad thing
        if result.status_code == 403:
            return "Invalid API key, use Parser.login(api_key)"
        else:
            return loads(result.text)

Is it possible to open a PR and to release it? It would be very pleasant for me and the company I work in since we're using pydocparser.

Thanks,
Thomas Monnier @papernest

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.