Coder Social home page Coder Social logo

linuxdevil / site-analyzer Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 691 KB

SiteAnalyzer is a Python tool that helps you analyze the color contrast and speed of websites, taking into account both light and dark themes. The tool follows the Web Content Accessibility Guidelines (WCAG) 2.1 AA level requirements for color contrast and suggests alternative colors when the contrast ratio is not met.

License: MIT License

Python 31.72% JavaScript 8.07% HTML 5.57% SCSS 2.32% TypeScript 52.31%
fcp lighthouse python site-analysis wcag2

site-analyzer's Introduction

SiteAnalyzer

SiteAnalyzer is a Python tool that helps you analyze the color contrast and speed of websites, taking into account both light and dark themes. The tool follows the Web Content Accessibility Guidelines (WCAG) 2.1 AA level requirements for color contrast and suggests alternative colors when the contrast ratio is not met. It also checks for large text contrast ratios and provides color suggestions for dark themes when needed. Additionally, SiteAnalyzer measures the First Contentful Paint (FCP) and site speed using the Playwright library.

Screenshot of the client

Features

  • Analyzes color contrast of websites based on WCAG 2.1 AA level requirements
  • Supports light and dark themes (including the prefers-color-scheme CSS media feature)
  • Suggests alternative colors for improved contrast
  • Handles rgba and transparent color values
  • Checks for large text contrast ratios
  • Provides color suggestions for dark themes
  • Measures First Contentful Paint (FCP) and site speed

Installation

  1. Install the required Python libraries using the following command:

pip install requests beautifulsoup4 cssutils pillow colour playwright

  1. Install Playwright browsers using the following command:

playwright install

  1. Download the SiteAnalyzer Python script from this repository.

  2. CD into the js folder and run the following command:

npm install

Usage SiteAnalyzer

  1. Run the SiteAnalyzer script using the following command:

python speed_analyzer.py

  1. When prompted, enter the URL of the website you want to analyze. The script will then analyze the site's FCP and site speed, providing suggestions if necessary.

Usage ColorAnalyzer

  1. Run the ColorAnalyzer script using the following command:

python color_analyzer.py

  1. When prompted, enter the URL of the website you want to analyze. The script will then analyze the site's color contrast, providing suggestions if necessary.

API

  1. Install the required Python libraries using the following command:

pip install fastapi uvicorn

  1. Run the API using the following command:

uvicorn api:app --reload

Client App

  1. Install the required npm libraries using the following command:

npm install

  1. Run the client app using the following command:

npm start

License

SiteAnalyzer is released under the MIT License.

Contributing

Contributions are welcome! Please feel free to submit a pull request or open an issue for bug reports or feature requests.

Support

If you encounter any issues or have questions, please open an issue on this repository.

site-analyzer's People

Contributors

canaangm avatar linuxdevil avatar

Watchers

 avatar

site-analyzer's Issues

Cannot find module

While testing the speed-analyzer.py , I came across an error.

image

I noticed that the node-app folder was missing,

and instead found a folder named js. To solve the issue, I renamed the js folder to node-app. However, this change led to another error, which is shown in the second image."
image

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.