r/pythoncoding • • Feb 09 '24

Extracting structured tables from PDF

7 Upvotes

As title says, I am working on a task to extract the contents of tables from a PDF. I am able to extract all of the text from the PDF using Fitz, which includes the headers and data from the table. The issue arises when I try to build some logic or pipeline to extract the table data from the text as there is no semantics or metadata denoting the difference between text & table.

Has anyone encountered this task before?

Things i’ve tried: OCR - Tabletransformer GPT4 - Actually performed quite well but not 100% reliable Rules based logic - pdfs reference tables differently or not at all.

Edit: SOLVED, tried 4/5 packages and found pdfplumber to be the best at extracting the table in a structured format. The flexibility of the extraction function is very useful too.


r/pythoncoding • • Oct 14 '23

I made a Library in Python for extract cookies

7 Upvotes

Hello everyone!

I made library in Python which let you extract cookies from every web browser on the planet

Useful for testing, automation, and just to learn how easy is to extract sessions from the browsers!

you can try it at https://github.com/thewh1teagle/rookie

let me know what you think about :)


r/pythoncoding • • Sep 08 '23

Edvart: An open-source Python library for generating data analysis reports 📊

Thumbnail
self.datascience
7 Upvotes

r/pythoncoding • • Jul 17 '23

YouTube Downloader made by using only Python

Thumbnail
github.com
7 Upvotes

r/pythoncoding • • Jul 02 '23

Sweep: AI developer that writes/fixes its own pull requests

7 Upvotes

I'm one of the developers of Sweep AI (YC S23). You can tell Sweep about the bugs and feature requests and Sweep will reply with code changes by creating a PR.

You can use Sweep Chat to ideate and clarify requirements with Sweep, eventually creating a pull request! Then anywhere GitHub takes text (PR comments, code comments), Sweep will read it and tweak the PR to your liking.

On the go? Simply write a GitHub issue prefixed with “Sweep:” and watch the magic happen.
We built Sweep by integrated search + GPT4-32k into Github, with a couple more tricks :D.

If you're interested in checking out our project, please visit: https://sweep.dev/


r/pythoncoding • • Jun 04 '23

/r/PythonCoding monthly "What are you working on?" thread

7 Upvotes

Share what you're working on in this thread. What's the end goal, what are design decisions you've made and how are things working out? Discussing trade-offs or other kinds of reflection are encouraged!

If you include code, we'll be more lenient with moderation in this thread: feel free to ask for help, reviews or other types of input that normally are not allowed.


r/pythoncoding • • May 21 '23

Important notice for the Python community

Thumbnail
self.cybernewsroom
7 Upvotes

r/pythoncoding • • Apr 18 '23

GPTDiscord Updates - Fully internet (google) and wolfram connected chats! GPT can access the links you send it while chatting, and more!

Thumbnail
self.gpt3
7 Upvotes

r/pythoncoding • • Mar 04 '23

/r/PythonCoding monthly "What are you working on?" thread

7 Upvotes

Share what you're working on in this thread. What's the end goal, what are design decisions you've made and how are things working out? Discussing trade-offs or other kinds of reflection are encouraged!

If you include code, we'll be more lenient with moderation in this thread: feel free to ask for help, reviews or other types of input that normally are not allowed.


r/pythoncoding • • Feb 02 '23

"Introducing "callpyback": Flexible callbacks for your code - Feedback and Contributions Wanted!

7 Upvotes

https://github.com/samuelgregorovic/callpyback

We are proud to announce the release of our new Python library, "callpyback" - a flexible and powerful tool for adding callbacks to your functions. With its wide range of features, you can customize the behavior of your functions in different stages of their execution, making it easier to build robust and reliable applications.

If you're a Python developer, we invite you to check out "callpyback" on GitHub at https://github.com/samuelgregorovic/callpyback. We would also love to hear your feedback and get your contributions to the project.

The "callpyback" library is still in its early stages, and we believe there is a lot of room for improvement. If you have any suggestions, bug reports, or feature requests, feel free to open an issue or submit a pull request on GitHub. Your contribution can help us make this library even better!

We hope you enjoy using "callpyback" as much as we enjoyed building it! Thank you for your support and we look forward to hearing from you.


r/pythoncoding • • Jan 23 '23

Comprehensive NLP blog on how to mitigate unintended bias in toxic comment classification. Please share your valuable feedback.

Thumbnail
ai.plainenglish.io
7 Upvotes

r/pythoncoding • • Nov 12 '22

This is how i got more performance in WebSockets than Node or Bun using Python

Thumbnail
self.python
7 Upvotes

r/pythoncoding • • Aug 22 '22

/r/PythonCoding bi-weekly "What are you working on?" thread

7 Upvotes

Share what you're working on in this thread. What's the end goal, what are design decisions you've made and how are things working out? Discussing trade-offs or other kinds of reflection are encouraged!

If you include code, we'll be more lenient with moderation in this thread: feel free to ask for help, reviews or other types of input that normally are not allowed.

This recurring thread is a new addition to the subreddit and will be evaluated after the first few editions.


r/pythoncoding • • Aug 08 '22

/r/PythonCoding bi-weekly "What are you working on?" thread

7 Upvotes

Share what you're working on in this thread. What's the end goal, what are design decisions you've made and how are things working out? Discussing trade-offs or other kinds of reflection are encouraged!

If you include code, we'll be more lenient with moderation in this thread: feel free to ask for help, reviews or other types of input that normally are not allowed.

This recurring thread is a new addition to the subreddit and will be evaluated after the first few editions.


r/pythoncoding • • Jul 25 '22

/r/PythonCoding bi-weekly "What are you working on?" thread

7 Upvotes

Share what you're working on in this thread. What's the end goal, what are design decisions you've made and how are things working out? Discussing trade-offs or other kinds of reflection are encouraged!

If you include code, we'll be more lenient with moderation in this thread: feel free to ask for help, reviews or other types of input that normally are not allowed.

This recurring thread is a new addition to the subreddit and will be evaluated after the first few editions.


r/pythoncoding • • Jul 02 '22

How to create classes without the class keyword

7 Upvotes

In Python, we learn that in order to create a class you need to start off with the `class` keyword. But the reality is that we actually don't.

I've written an article on how this works. We take a deeper dive into data types in Python and explore how they work under the hood.

I explore how all data types are classes, and how they can all be derived from `type` which by the way can do more than tell you the type of an object! Check out the article below if this sounds intriguing.

https://medium.com/@Salaah01/creating-a-class-in-python-without-the-class-keyword-67ce84bae22


r/pythoncoding • • May 18 '22

Using OTEL with FAST API and Pika

Thumbnail
betterprogramming.pub
7 Upvotes

r/pythoncoding • • Dec 27 '21

/r/PythonCoding bi-weekly "What are you working on?" thread

7 Upvotes

Share what you're working on in this thread. What's the end goal, what are design decisions you've made and how are things working out? Discussing trade-offs or other kinds of reflection are encouraged!

If you include code, we'll be more lenient with moderation in this thread: feel free to ask for help, reviews or other types of input that normally are not allowed.

This recurring thread is a new addition to the subreddit and will be evaluated after the first few editions.


r/pythoncoding • • Oct 02 '21

looking to build out a simple web scrapper for a working stock scanner/ filter

7 Upvotes

Hi,

8 bit here, veteran trader and problem solver. Not fluent with coding but algorithms and systematic thinking are in my wheel house. I am looking to build a GUI using a web scrapper and some "if Then" functions to make my scanning and filtration process more streamlined and efficient. If you are qualified and interested in this niche and would like to work together on this project please feel free to message me.


r/pythoncoding • • Apr 05 '21

/r/PythonCoding bi-weekly "What are you working on?" thread

7 Upvotes

Share what you're working on in this thread. What's the end goal, what are design decisions you've made and how are things working out? Discussing trade-offs or other kinds of reflection are encouraged!

If you include code, we'll be more lenient with moderation in this thread: feel free to ask for help, reviews or other types of input that normally are not allowed.

This recurring thread is a new addition to the subreddit and will be evaluated after the first few editions.


r/pythoncoding • • Mar 08 '21

/r/PythonCoding bi-weekly "What are you working on?" thread

7 Upvotes

Share what you're working on in this thread. What's the end goal, what are design decisions you've made and how are things working out? Discussing trade-offs or other kinds of reflection are encouraged!

If you include code, we'll be more lenient with moderation in this thread: feel free to ask for help, reviews or other types of input that normally are not allowed.

This recurring thread is a new addition to the subreddit and will be evaluated after the first few editions.


r/pythoncoding • • Aug 05 '17

OnlineGDB: Introducing python debug mode with PDB console.

Thumbnail
onlinegdb.com
7 Upvotes

r/pythoncoding • • Oct 12 '16

PyCaribbean Call to Proposals is open (X-Post from r/python)

7 Upvotes

Hi everyone!

We want to invite you all to PyCaribbean on February 18-19, 2017, in Bayamón Puerto Rico. If you ever wanted to talk Python and be with an awesome community in a tropical getaway this is your chance.

We are currently accepting talk proposals and have our early bird tickets up. Join us at http://pycaribbean.com

For any addition information you can contact us at any of the following, we would love to hear from you.

[email protected]

Twitter: @pycaribbean

Slack: http://slack.pycaribbean.com


r/pythoncoding • • Apr 11 '26

safezip - A small, zero-dependency wrapper for secure ZIP extraction

6 Upvotes

I wrote a small, zero-dependency wrapper for secure ZIP extraction.

https://github.com/barseghyanartur/safezip

What My Project Does

safezip is a zero-dependency wrapper around Python's zipfile module that makes secure ZIP extraction the default. It protects against:

  • ZipSlip protection: Blocks relative paths, absolute paths, Windows UNC paths, Unicode lookalike attacks, and null bytes in filenames.

  • ZIP bomb prevention: Enforces per-member and cumulative decompression ratio limits at stream time — not based on untrusted header values.

  • ZIP64 consistency checks: Crafted archives with inconsistent ZIP64 extra fields are rejected before decompression begins.

  • Symlink policy — configurable: REJECT (default), IGNORE, or RESOLVE_INTERNAL.

  • Atomic writes: Extracts to a temp file first and only moves it to the destination if all checks pass. If something fails, you don't end up with half-extracted junk on your disk.

  • Environment variable overrides: All numeric limits can be set via SAFEZIP_* environment variables for containerised deployments.

It's meant to be an almost drop-in replacement. You can just do:

from safezip import safe_extract

safe_extract("path/to/file.zip", "/var/files/extracted/")

If you need more control, there’s a SafeZipFile context manager that lets you tweak limits or monitor security events.

from safezip import SafeZipFile

with SafeZipFile("path/to/file.zip") as zf:
    print(zf.namelist())
    zf.extractall("/var/files/extracted/")

Target Audience

If you're handling user uploads or processing ZIP files from untrusted sources, this might save you some headache. It's production-oriented but currently in beta, so feedback and edge cases are very welcome.

Comparison

The standard library's zipfile module historically wasn't safe to use on untrusted files. Even the official docs warn against extractall() because of ZipSlip risks, and it doesn't do much to stop ZIP bombs from eating up your disk or memory. Python 3.12 did address some of this — extractall() now strips path components that would escape the target directory — but it still leaves meaningful gaps: no ZIP bomb protection, no stream-time size enforcement, no symlink policy, no ZIP64 consistency checks, and no atomic writes. safezip fills all of those. I got tired of writing the same boilerplate every time, so I packaged it up.

----

Documentation: https://safezip.readthedocs.io/en/latest/