Skip to content

Python client for MagicalAPI: resume parsing, resume scoring, LinkedIn profile and company data extraction for hiring and business insights.

License

Notifications You must be signed in to change notification settings

magicalapi/magicalapi-python

Repository files navigation

PyPI - Version PyPI - Python Version Downloads

Tests Issues Stargazers MIT License


Logo

MagicalAPI Python Client

An Async and Type Annotated Python Client to Easy Access MagicalAPI.com Service.
Report Bug · Request Feature

Table of Contents

What is MagicalAPI?

MagicalAPI is your AI edge in careers and data insights, Your ultimate tool for Resume Parsing, LinkedIn data and more. It offers services like:

  • Resume Parsing: Extract structured data from resumes.
  • LinkedIn Data Extraction: Scrape and analyze LinkedIn profiles.
  • Career Insights: Gain AI-driven recommendations for career development.

Features

  • Resume Parsing: Parse resumes to extract key information like skills, experience, and education.
  • LinkedIn Profile Scraping: Extract data from LinkedIn profiles for analysis.
  • Career Insights: Leverage AI to get actionable career recommendations.
  • Type-Annotated and Async: Built for modern Python with type hints and asynchronous support.

About The Project

This is a Python client that provides easy access to the MagicalAPI.com services, fully type annotated, and asynchronous.

(back to top)

Getting Started

This is an example of how you can install the client and use it in your own scripts and projects.

Installation

Install package using pip

pip install magicalapi

(back to top)

Usage

here are some samples of how to use the client for each service. At first, you have to create an object of AsyncClient like this:

from magicalapi.client import AsyncClient

API_KEY = "mag_123456"
client = AsyncClient(api_key=API_KEY)

You can pass the API_KEY on the code, or put it on a .env file and the client will read from there.

Config .env File

Example of using .env file, all settings start with the prefix MAG_ and are case insensitive, so MAG_EXAMPLE, Mag_example, and mag_EXAMPLE are equal.

# .env

MAG_API_KEY="mag_1234567"

So now you can leave api_key parameter empty.

from magicalapi.client import AsyncClient

client = AsyncClinet()

Here is an example of how to parse a resume using Resume Parser service:

import asyncio

from magicalapi.client import AsyncClient
from magicalapi.errors import APIServerError, APIServerTimedout
from magicalapi.types.base import ErrorResponse

resume_url = (
    "https://resume-resource.com/wp-content/uploads/00123-sales-professional-resume.pdf"
)
output_file_name = "resume_parser.json"


async def main():
    try:
        # the api_key will load from the .env file
        async with AsyncClient() as client:
            response = await client.resume_parser.get_resume_parser(url=resume_url)

            if isinstance(response, ErrorResponse):
                # got error from api
                print("Error :", response.message)
            else:
                # got response successfully
                print("credists :", response.usage.credits)
                # save response in json file
                with open(output_file_name, "w") as file:
                    file.write(response.model_dump_json(indent=3))

                    print(f"response saved to {output_file_name}")
    except (APIServerError, APIServerTimedout) as e:
        # handling server errors
        print(e)
    except Exception as e:
        print("An error occurred:", str(e))


asyncio.run(main())

All of the methods in the client have type hints and help to simply use.

For full examples, please see the Examples Directory

(back to top)

Contributing

Contributions are what makes the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

Here is the Contributing Guidelines. Don't forget to give the project a star! Thanks again!

(back to top)

License

Distributed under the MIT License. See LICENSE for more information.

(back to top)

About

Python client for MagicalAPI: resume parsing, resume scoring, LinkedIn profile and company data extraction for hiring and business insights.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages