NOVELTY - Producing a methane product gas from a feed gas comprising a mixture of methane, carbon dioxide, nitrogen, oxygen, and water vapor, by using multiple pressure swing adsorption (PSA) and/or temperature swing adsorption (TSA) stages e.g. first PSA stage where carbon dioxide and water vapor are removed from the feed gas to produce a first intermediate product stream containing less than 2% carbon dioxide and less than 20 ppm water vapor; and a second PSA stage where nitrogen and oxygen are removed from first intermediate product.    USE - For producing a methane product gas from a feed gas comprising a mixture of methane, carbon dioxide, nitrogen, oxygen, and water vapor (claimed).    ADVANTAGE - The method produces a methane-rich product gas that meets certain purity requirements, e.g. for liquefaction or for distribution via pipeline, and a byproduct gas containing most of the carbon dioxide, nitrogen, oxygen, and water. The methane product gas is enriched in methane compared to the feed gas. The adsorption system offers significant advantages compared with independent adsorption or membrane-based systems, operating as the identified stages, on account of the synergistic effects made possible by making maximum use of the waste products from the individual stages. The adsorption system also offers economic advantages compared with cryogenic distillation.    DETAILED DESCRIPTION - Producing a methane product gas from a feed gas comprising a mixture of methane, carbon dioxide, nitrogen, oxygen, and water vapor, where the methane product gas is enriched in methane compared to the feed gas, where the method involves:    (1) a first pressure swing adsorption (PSA) stage where carbon dioxide and water vapor are removed from the feed gas to produce a first intermediate product stream enriched in methane, oxygen, and nitrogen, compared to the feed gas; a second temperature swing adsorption (TSA) stage, where carbon dioxide and water are removed from the first intermediate product stream to produce a second intermediate product containing less than 35 ppm carbon dioxide and less than 35 ppm water vapor; and a third PSA stage where nitrogen and oxygen are removed from the second intermediate product to produce the methane product gas having less than 50 ppm carbon dioxide, less than 0.5 ppm water vapor, less than 5% nitrogen, and less than 1% oxygen; or    (2) a first pressure swing adsorption (PSA) stage where carbon dioxide and water vapor are removed from the feed gas to produce a first intermediate product stream enriched in methane, oxygen, and nitrogen, compared to the feed gas; a second PSA stage, where carbon dioxide and water are removed from the first intermediate product stream to produce a second intermediate product containing less than 35 ppm carbon dioxide and less than 0.35 ppm water vapor; and a third PSA stage where nitrogen and oxygen are removed from the second intermediate product to produce the methane product gas having less than 50 ppm carbon dioxide, less than 0.5 ppm water vapor, less than 5% nitrogen, and less than 1% oxygen; or    (3) a first pressure swing adsorption (PSA) stage where carbon dioxide and water vapor are removed from the feed gas to produce a first intermediate product stream containing less than 2% or 35 ppm carbon dioxide and less than 20 (preferably 0.35) ppm water vapor; and (b) a second PSA stage where nitrogen and oxygen are removed from the first intermediate product to produce the methane product gas having less than 3% or less than 50 ppm carbon dioxide, less than 30 (preferably less than 0.5) ppm water vapor, less than 5% nitrogen, and less than 1% oxygen.