๐ Today’s Picks
Create Safe Temporary Files with Python tempfile
Problem
Unit tests that create files for testing data processing functions often leave behind test artifacts or fail due to file conflicts.
Running test suites in parallel or repeatedly creates naming conflicts and cluttered test environments.
Solution
Python’s tempfile module ensures test isolation by creating unique temporary files that automatically cleanup after each test.
Key benefits:
- Automatic cleanup after test completion
- Secure file creation with proper permissions
- No naming conflicts between parallel tests
- Production-safe workflows for processing large datasets
Use tempfile.NamedTemporaryFile() with context managers to process data in chunks without leaving artifacts behind.
GLiNER: Zero-Shot Entity Recognition Without Retraining
Problem
While spaCy provides excellent NER capabilities, its models need retraining for new entity types, which requires collecting training data, labeling examples, and running expensive model fine-tuning.
This means weeks of model preparation before you can extract custom entities from your text data.
Solution
GLiNER enables zero-shot entity recognition by accepting entity types as runtime parameters.
With GLiNER, you can simply specify your desired entity types and get instant extraction results without any training.
โ๏ธ Weekly Finds
browser-use [LLM] – Make websites accessible for AI agents. Automate tasks online with ease.
tiktoken [LLM] – tiktoken is a fast BPE tokeniser for use with OpenAI’s models.
FuzzTypes [Python Utils] – Pydantic extension for annotating autocorrecting fields.
Looking for a specific tool? Explore 70+ Python tools โ
Stay Current with CodeCut
Actionable Python tips, curated for busy data pros. Skim in under 2 minutes, three times a week.


