Skip to content

Commit f41070f

Browse files
loreyclaude
andcommitted
chore: migrate from master to main branch
πŸ€– Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 2c244f1 commit f41070f

File tree

3 files changed

+61
-3
lines changed

3 files changed

+61
-3
lines changed

β€Ž.github/workflows/ci.ymlβ€Ž

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: CI
22

33
on:
44
push:
5-
branches: [master, main]
5+
branches: [main]
66
pull_request:
7-
branches: [master, main]
7+
branches: [main]
88

99
jobs:
1010
lint:

β€ŽCLAUDE.mdβ€Ž

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# CLAUDE.md
2+
3+
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4+
5+
## Project Overview
6+
7+
Socials is a Python library for detecting and extracting social media profile URLs from a list of hrefs. It uses regex pattern matching to identify URLs from Facebook, Twitter, LinkedIn, GitHub, Instagram, YouTube, and email addresses.
8+
9+
## Development Commands
10+
11+
```bash
12+
# Setup
13+
virtualenv -p /usr/bin/python3 venv
14+
source venv/bin/activate
15+
pip install -r requirements-dev.txt
16+
17+
# Testing
18+
tox # Multi-Python version testing
19+
python setup.py test # Single test run
20+
make test # Alternative: runs py.test
21+
22+
# Linting
23+
make lint # Runs flake8 socials tests
24+
25+
# Coverage
26+
make coverage # Generates HTML coverage report
27+
28+
# Release (requires bumpversion)
29+
bumpversion patch && git push --tags
30+
```
31+
32+
## Architecture
33+
34+
The library is a single-module design in `socials/socials.py`:
35+
36+
- **Platform constants**: `PLATFORM_FACEBOOK`, `PLATFORM_GITHUB`, etc.
37+
- **Regex patterns**: Each platform has a list of regex patterns (e.g., `FACEBOOK_URL_REGEXS`)
38+
- **PATTERNS dict**: Maps platform constants to their regex lists
39+
- **Extraction class**: Wrapper returned by `socials.extract()` with methods:
40+
- `get_matches_per_platform()` - returns dict of all matches by platform
41+
- `get_matches_for_platform(platform)` - returns list for specific platform
42+
- **Cleaners**: Optional post-processing functions (e.g., `clean_mailto` strips `mailto:` prefix)
43+
44+
## Adding a New Platform
45+
46+
1. Add platform constant: `PLATFORM_X = 'x'`
47+
2. Add regex list: `X_URL_REGEXS = [r'^http(s)?://...']`
48+
3. Add to `PATTERNS` dict
49+
4. Add test cases in `tests/test_socials.py`
50+
5. If needed, add cleaner function and register in `get_cleaner()`
51+
52+
## Regex Conventions
53+
54+
- All patterns use `^` and `$` anchors for exact matching
55+
- Character classes use `[A-Za-z0-9_-]` (avoiding chars between Z and a in ASCII)
56+
- Optional trailing slash: `/?$`
57+
- Optional https: `http(s)?://`
58+
- Optional www: `(www\.)?`

β€Ždocs/changelog.mdβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# Changelog
22

3-
See [CHANGELOG.md on GitHub](https://github.com/lorey/socials/blob/master/CHANGELOG.md) for the full changelog.
3+
See [CHANGELOG.md on GitHub](https://github.com/lorey/socials/blob/main/CHANGELOG.md) for the full changelog.

0 commit comments

Comments
Β (0)